-struct listitem * stopforgc(struct garbagelist * ptr) {
- struct listitem * litem=malloc(sizeof(struct listitem));
+void stopforgc(struct garbagelist * ptr) {
+#ifdef DELAYCOMP
+ //just append us to the list
+ ptrstack.prev=ptr;
+ ptr=(struct garbagelist *) &ptrstack;
+#endif
+#ifndef MAC
+ litem.stackptr=ptr;
+#ifdef THREADS
+ litem.locklist=pthread_getspecific(threadlocks);
+#endif
+#ifdef STM
+ litem.tc_size=c_size;
+ litem.tc_table=&c_table;
+ litem.tc_list=&c_list;
+ litem.tc_structs=&c_structs;
+ litem.objlist=newobjs;
+#ifdef STMSTATS
+ litem.lockedlist=lockedobjs;
+#endif
+ litem.base=&memorybase;
+#endif
+#else
+ //handle MAC
+ struct listitem *litem=pthread_getspecific(litemkey);