From beeaa02697b5d537f6fbc80ae8e18ae1912e42ab Mon Sep 17 00:00:00 2001 From: bdemsky Date: Sat, 15 Sep 2007 04:45:44 +0000 Subject: [PATCH] changes --- Robust/src/Runtime/DSTM/interface/trans.c | 37 ++++++++++++++++++----- 1 file changed, 30 insertions(+), 7 deletions(-) diff --git a/Robust/src/Runtime/DSTM/interface/trans.c b/Robust/src/Runtime/DSTM/interface/trans.c index e8e16c9e..ca09e1a0 100644 --- a/Robust/src/Runtime/DSTM/interface/trans.c +++ b/Robust/src/Runtime/DSTM/interface/trans.c @@ -200,7 +200,11 @@ objheader_t *transRead(transrecord_t *record, unsigned int oid) { /* Search local transaction cache */ if((objheader = (objheader_t *)chashSearch(record->lookupTable, oid)) != NULL){ - return(objheader); +#ifdef COMPILER + return &objheader[1]; +#else + return objheader; +#endif } else if ((objheader = (objheader_t *) mhashSearch(oid)) != NULL) { /* Look up in machine lookup table and copy into cache*/ tmp = mhashSearch(oid); @@ -209,7 +213,11 @@ objheader_t *transRead(transrecord_t *record, unsigned int oid) { memcpy(objcopy, (void *)objheader, size); /* Insert into cache's lookup table */ chashInsert(record->lookupTable, OID(objheader), objcopy); - return(objcopy); +#ifdef COMPILER + return &objcopy[1]; +#else + return objcopy; +#endif } else if((tmp = (objheader_t *) prehashSearch(oid)) != NULL) { /* Look up in prefetch cache */ found = 1; size = sizeof(objheader_t)+classsize[TYPE(tmp)]; @@ -217,7 +225,11 @@ objheader_t *transRead(transrecord_t *record, unsigned int oid) { memcpy(objcopy, (void *)tmp, size); /* Insert into cache's lookup table */ chashInsert(record->lookupTable, OID(tmp), objcopy); - return(objcopy); +#ifdef COMPILER + return &objcopy[1]; +#else + return objcopy; +#endif } else { /* If not found anywhere, then block until object appears in prefetch cache */ #if 0 printf("Inside remote machine\n"); @@ -234,7 +246,11 @@ objheader_t *transRead(transrecord_t *record, unsigned int oid) { memcpy(objcopy, (void *)tmp, size); /* Insert into cache's lookup table */ chashInsert(record->lookupTable, OID(tmp), objcopy); - return(objcopy); +#ifdef COMPILER + return &objcopy[1]; +#else + return objcopy; +#endif } else { pthread_mutex_unlock(&pflookup.lock); break; @@ -249,9 +265,12 @@ objheader_t *transRead(transrecord_t *record, unsigned int oid) { if(objcopy == NULL) { //If object is not found in Remote location return NULL; - } - else { - return(objcopy); + } else { +#ifdef COMPILER + return &objcopy[1]; +#else + return objcopy; +#endif } } } @@ -265,7 +284,11 @@ objheader_t *transCreateObj(transrecord_t *record, unsigned int size) tmp->rcount = 1; STATUS(tmp) = NEW; chashInsert(record->lookupTable, OID(tmp), tmp); +#ifdef COMPILER + return &tmp[1]; //want space after object header +#else return tmp; +#endif } /* This function creates machine piles based on all machines involved in a -- 2.34.1