test change
authorbdemsky <bdemsky>
Mon, 10 Sep 2007 23:47:00 +0000 (23:47 +0000)
committerbdemsky <bdemsky>
Mon, 10 Sep 2007 23:47:00 +0000 (23:47 +0000)
Robust/src/README
Robust/src/Runtime/DSTM/interface/dstm.h
Robust/src/Runtime/DSTM/interface/trans.c
Robust/src/Runtime/runtime.c

index 55b172314624598055a005f5fc2bafbdab382800..b623359c0d07c3e10dbf87ca576170f743b9aeed 100644 (file)
@@ -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/
+
index 2574271af720880e874c19ff29c4aa3ba047204a..531cb736faa82a67804152e9f29ed7189fb59a13 100644 (file)
@@ -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 
index 83bdaa6fcbc9c3d7ff9fac267108609f23e38479..881baf1fba251acfcc921d89ac8fbc4a5dd4db8e 100644 (file)
@@ -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
index f9f7e2a58b60889fb42b34b02da5f9607a452895..9422b68149016aed1d5c5e586363dc12f61fe3ea 100644 (file)
@@ -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;