From 7cc26734a218bb53fad56f09220be58d2509ec39 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Mon, 10 Sep 2007 23:47:00 +0000 Subject: [PATCH] test change --- Robust/src/README | 3 ++- Robust/src/Runtime/DSTM/interface/dstm.h | 2 +- Robust/src/Runtime/DSTM/interface/trans.c | 17 ++++++++--------- Robust/src/Runtime/runtime.c | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Robust/src/README b/Robust/src/README index 55b17231..b623359c 100644 --- a/Robust/src/README +++ b/Robust/src/README @@ -1 +1,2 @@ -See the wiki page at http://demsky.eecs.uci.edu/compiler/ \ No newline at end of file +See the wiki page at http://demsky.eecs.uci.edu/compiler/ + diff --git a/Robust/src/Runtime/DSTM/interface/dstm.h b/Robust/src/Runtime/DSTM/interface/dstm.h index 2574271a..531cb736 100644 --- a/Robust/src/Runtime/DSTM/interface/dstm.h +++ b/Robust/src/Runtime/DSTM/interface/dstm.h @@ -210,7 +210,7 @@ void transInit(); void randomdelay(void); transrecord_t *transStart(); objheader_t *transRead(transrecord_t *, unsigned int); -objheader_t *transCreateObj(transrecord_t *, unsigned short); //returns oid +objheader_t *transCreateObj(transrecord_t *, unsigned int); //returns oid int transCommit(transrecord_t *record); //return 0 if successful void *transRequest(void *); //the C routine that the thread will execute when TRANS_REQUEST begins void *handleLocalReq(void *); //the C routine that the local m/c thread will execute diff --git a/Robust/src/Runtime/DSTM/interface/trans.c b/Robust/src/Runtime/DSTM/interface/trans.c index 83bdaa6f..881baf1f 100644 --- a/Robust/src/Runtime/DSTM/interface/trans.c +++ b/Robust/src/Runtime/DSTM/interface/trans.c @@ -245,16 +245,15 @@ objheader_t *transRead(transrecord_t *record, unsigned int oid) { } /* This function creates objects in the transaction record */ -objheader_t *transCreateObj(transrecord_t *record, unsigned short type) +objheader_t *transCreateObj(transrecord_t *record, unsigned int size) { - objheader_t *tmp = (objheader_t *) objstrAlloc(record->cache, (sizeof(objheader_t) + classsize[type])); - OID(tmp) = getNewOID(); - TYPE(tmp) = type; - tmp->version = 1; - tmp->rcount = 1; - STATUS(tmp) = NEW; - chashInsert(record->lookupTable, OID(tmp), tmp); - return tmp; + objheader_t *tmp = (objheader_t *) objstrAlloc(record->cache, (sizeof(objheader_t) + size)); + OID(tmp) = getNewOID(); + tmp->version = 1; + tmp->rcount = 1; + STATUS(tmp) = NEW; + chashInsert(record->lookupTable, OID(tmp), tmp); + return tmp; } /* This function creates machine piles based on all machines involved in a diff --git a/Robust/src/Runtime/runtime.c b/Robust/src/Runtime/runtime.c index f9f7e2a5..9422b681 100644 --- a/Robust/src/Runtime/runtime.c +++ b/Robust/src/Runtime/runtime.c @@ -91,7 +91,7 @@ void CALL01(___System______printString____L___String___,struct ___String___ * __ #ifdef DSTM void * allocate_newglobal(transrecord_t *trans, int type) { - struct ___Object___ * v=(struct ___Object___ *) dstmalloc(trans, classsize[type]); + struct ___Object___ * v=(struct ___Object___ *) transCreateObj(trans, classsize[type]); v->type=type; #ifdef THREADS v->tid=0; @@ -104,12 +104,12 @@ void * allocate_newglobal(transrecord_t *trans, int type) { /* Array allocation function */ struct ArrayObject * allocate_newarrayglobal(transrecord_t *trans, int type, int length) { - struct ArrayObject * v=(struct ArrayObject *)dstmalloc(trans, classsize[type]); - v->type=type; + struct ArrayObject * v=(struct ArrayObject *)transCreateObj(trans, sizeof(struct ArrayObject)+length*classsize[type]); if (length<0) { printf("ERROR: negative array\n"); return NULL; } + v->type=type; v->___length___=length; #ifdef THREADS v->tid=0; -- 2.34.1