From 10754cfe6c3daf51777047f189576b0d4b1946ed Mon Sep 17 00:00:00 2001 From: bdemsky Date: Wed, 14 Oct 2009 08:45:26 +0000 Subject: [PATCH] back to compiling --- Robust/src/Runtime/STM/commit.c | 20 +++++++++++--------- Robust/src/Runtime/STM/stm.c | 8 ++++---- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Robust/src/Runtime/STM/commit.c b/Robust/src/Runtime/STM/commit.c index 885a405f..912ceb38 100644 --- a/Robust/src/Runtime/STM/commit.c +++ b/Robust/src/Runtime/STM/commit.c @@ -243,8 +243,8 @@ int transCommit() { if (type>=NUMCLASSES) { \ struct ArrayObject *transao=(struct ArrayObject *) cachedobj; \ struct ArrayObject *mainao=(struct ArrayObject *) objptr; \ - int lowoffset=(transao->lowoffset)>>INDEXSHIFT; \ - int highoffset=(transao->highoffset)>>INDEXSHIFT; \ + int lowoffset=(transao->lowindex)>>INDEXSHIFT; \ + int highoffset=(transao->highindex)>>INDEXSHIFT; \ int j; \ int addwrobject=0, addrdobject=0; \ for(j=lowoffset; j<=highoffset;j++) { \ @@ -278,18 +278,18 @@ int transCommit() { dirwrlocked[numoidwrlocked++] = objptr; \ } \ if (addrdobject) { \ - rdlockedarray[numrdlockedarray++]=objptr; \ + rdlockedarray[numoidrdlockedarray++]=objptr; \ } \ } else -#define READDARRAYS \ +#define READARRAYS \ for(i=0; ilowoffset)>>INDEXSHIFT; \ - int highoffset=(transao->highoffset)>>INDEXSHIFT; \ + int lowoffset=(transao->lowindex)>>INDEXSHIFT; \ + int highoffset=(transao->highindex)>>INDEXSHIFT; \ int j; \ for(j=lowoffset; j<=highoffset;j++) { \ int locallock;GETLOCKVAL(locallock,transao,j); \ @@ -314,7 +314,7 @@ int transCommit() { #else #define ARRAYDEFINES #define PROCESSARRAY -#define READDARRAYS +#define READARRAYS #define STMARRAYFREE #define STMARRAYALLOC #define STMARRAYASSIGN @@ -360,7 +360,8 @@ int transCommit() { //if the first bin in hash table is empty if(curr->key == NULL) break; - objheader_t * headeraddr=&((objheader_t *) curr->val)[-1]; //cached object + objheader_t * cachedobj=curr->val; + objheader_t * headeraddr=&((objheader_t *) cachedobj)[-1]; //cached object void * objptr=curr->key; objheader_t *header=(objheader_t *)(((char *)objptr)-sizeof(objheader_t)); //real object unsigned int version = headeraddr->version; @@ -597,7 +598,8 @@ int alttraverseCache() { /* Inner loop to traverse the linked list of the cache lookupTable */ while(likely(curr != NULL)) { //if the first bin in hash table is empty - objheader_t * headeraddr=&((objheader_t *) curr->val)[-1]; + objheader_t * cachedobj=curr->val; + objheader_t * headeraddr=&((objheader_t *) cachedobj)[-1]; void *objptr=curr->key; objheader_t *header=(objheader_t *)(((char *)objptr)-sizeof(objheader_t)); unsigned int version = headeraddr->version; diff --git a/Robust/src/Runtime/STM/stm.c b/Robust/src/Runtime/STM/stm.c index 0db8e33c..ff577915 100644 --- a/Robust/src/Runtime/STM/stm.c +++ b/Robust/src/Runtime/STM/stm.c @@ -206,10 +206,10 @@ void *transRead(void * oid, void *gl) { struct ArrayObject * orig=(struct ArrayObject *) oid->___objlocation___; int baseoffset=byteindex&HIGHMASK; A_memcpy(((char *)&oid[1])+baseoffset, ((char *)&orig[1])+baseoffset, INDEXLENGTH); - if (oid->lowoffset>baseoffset) - oid->lowoffset=baseoffset; - if (oid->highoffsethighoffset=baseoffset; + if (oid->lowindex>baseoffset) + oid->lowindex=baseoffset; + if (oid->highindexhighindex=baseoffset; } #endif -- 2.34.1