From b2fad11b23320ff0b0be450cbd4859dd0795020e Mon Sep 17 00:00:00 2001 From: jzhou Date: Sun, 27 Mar 2011 02:28:04 +0000 Subject: [PATCH] Bug fix in MGC version: bamboo_threadlocks is also a Runtime reference that should be checked and flushed during GC --- Robust/src/Runtime/bamboo/multicoregarbage.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Robust/src/Runtime/bamboo/multicoregarbage.c b/Robust/src/Runtime/bamboo/multicoregarbage.c index 41c33447..fdb51b7a 100644 --- a/Robust/src/Runtime/bamboo/multicoregarbage.c +++ b/Robust/src/Runtime/bamboo/multicoregarbage.c @@ -26,6 +26,10 @@ extern unsigned int gcmem_mixed_threshold; extern unsigned int gcmem_mixed_usedmem; #endif +#ifdef MGC +extern INTPTR bamboo_threadlocks; +#endif + struct pointerblock { void * ptrs[NUMPTRS]; struct pointerblock *next; @@ -1193,6 +1197,11 @@ inline void tomark(struct garbagelist * stackptr) { } } + // enqueue the bamboo_threadlocks + if(bamboo_threadlocks != 0) { + markObj((void *)bamboo_threadlocks); + } + GC_BAMBOO_DEBUGPRINT(0xe50a); #endif } // void tomark(struct garbagelist * stackptr) @@ -2316,6 +2325,11 @@ inline void flushRuntimeObj(struct garbagelist * stackptr) { #endif #ifdef MGC + // flush the bamboo_threadlocks + if(bamboo_threadlocks != 0) { + bamboo_threadlocks = (INTPTR)(flushObj((void *)bamboo_threadlocks)); + } + // flush global thread queue if(STARTUPCORE == BAMBOO_NUM_OF_CORE) { unsigned int thread_counter = *((unsigned int*)(bamboo_thread_queue+1)); @@ -3277,7 +3291,6 @@ inline void gc_master(struct garbagelist * stackptr) { bool isfirst = true; bool allStall = false; - #ifdef GC_CACHE_ADAPT // prepare for cache adaption: cacheAdapt_gc(true); @@ -3307,7 +3320,6 @@ inline void gc_master(struct garbagelist * stackptr) { printf("(%x,%x) Start mark phase \n", udn_tile_coord_x(), udn_tile_coord_y()); #endif - // all cores have finished compacting // restore the gcstatus of all cores // Note: all cores have to do mark including non-gc cores gccorestatus[BAMBOO_NUM_OF_CORE] = 1; -- 2.34.1