add garbage collection support to delaycomp
authorbdemsky <bdemsky>
Thu, 25 Jun 2009 23:40:42 +0000 (23:40 +0000)
committerbdemsky <bdemsky>
Thu, 25 Jun 2009 23:40:42 +0000 (23:40 +0000)
Robust/src/Runtime/garbage.c

index 88bbdd3dc6726a6475292a584fb41835cb8b4891..79948c2c978ab6d239c581273758ca58a2cb0357 100644 (file)
 #ifdef STM
 #include "tm.h"
 #endif
+#ifdef DELAYCOMP
+#include "delaycomp.h"
+#endif
+
 
 #define NUMPTRS 100
 
@@ -291,6 +295,10 @@ void collect(struct garbagelist * stackptr) {
     pthread_cond_wait(&gccond, &gclistlock);
   }
 #endif
+#ifdef DELAYCOMP
+  ptrstack.prev=stackptr;
+  stackptr=(struct garbagelist *) &ptrstack;
+#endif
 
 #ifdef GARBAGESTATS
   {
@@ -625,6 +633,11 @@ void checkcollect2(void * ptr) {
 #endif
 
 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