From: bdemsky Date: Tue, 7 Apr 2009 06:39:06 +0000 (+0000) Subject: memory stuff X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=bb1dc9a2a66e0bf9ea07b37a810f6fbc62696656;p=IRC.git memory stuff --- diff --git a/Robust/src/Runtime/garbage.c b/Robust/src/Runtime/garbage.c index 96335d00..539119e2 100644 --- a/Robust/src/Runtime/garbage.c +++ b/Robust/src/Runtime/garbage.c @@ -48,6 +48,16 @@ int listcount=0; //Need to check if pointers are transaction pointers //this also catches the special flag value of 1 for local copies #ifdef DSTM +#define ENQUEUE(orig, dst) \ + if ((!(((unsigned int)orig)&0x1))) { \ + if (orig>=curr_heapbase&&orig=curr_heapbase&&orignext; } -#if defined(THREADS)||defined(DSTM) +#if defined(THREADS)||defined(DSTM)||defined(STM) /* Go to next thread */ if (listptr!=NULL) { void * orig=listptr->locklist; @@ -206,8 +216,7 @@ void collect(struct garbagelist * stackptr) { /* Update objectsets */ int i; for(i=0; iobjectset; @@ -443,7 +452,14 @@ void checkcollect2(void * ptr) { struct listitem * stopforgc(struct garbagelist * ptr) { struct listitem * litem=malloc(sizeof(struct listitem)); litem->stackptr=ptr; +#ifdef THREADS litem->locklist=pthread_getspecific(threadlocks); +#endif +#ifdef STM + litem->tc_size=c_size; + litem->tc_mask=c_mask; + litem->tc_table=&c_table; +#endif litem->prev=NULL; pthread_mutex_lock(&gclistlock); litem->next=list; diff --git a/Robust/src/Runtime/garbage.h b/Robust/src/Runtime/garbage.h index b9c533f5..41ec5ea1 100644 --- a/Robust/src/Runtime/garbage.h +++ b/Robust/src/Runtime/garbage.h @@ -10,7 +10,14 @@ struct listitem { struct listitem * prev; struct listitem * next; struct garbagelist * stackptr; +#ifdef THREADS struct ___Object___ * locklist; +#endif +#ifdef STM + unsigned int tc_size; + unsigned int tc_mask; + chashlistnode_t **tc_table; +#endif }; #ifdef TASK