From: bdemsky Date: Wed, 20 Jul 2011 00:20:42 +0000 (+0000) Subject: bug fix X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=047ec64ccc9962633c828488ecc96ae5bb30b730;p=IRC.git bug fix --- diff --git a/Robust/src/Runtime/bamboo/multicoregarbage.c b/Robust/src/Runtime/bamboo/multicoregarbage.c index c705f19f..5f367e6d 100644 --- a/Robust/src/Runtime/bamboo/multicoregarbage.c +++ b/Robust/src/Runtime/bamboo/multicoregarbage.c @@ -282,6 +282,13 @@ void gc_collect(struct garbagelist * stackptr) { // do gc send_msg_4(STARTUPCORE,GCFINISHPRE,BAMBOO_NUM_OF_CORE,self_numsendobjs,self_numreceiveobjs); + // invalidate all shared mem pointers + bamboo_cur_msp = NULL; + bamboo_smem_size = 0; + bamboo_smem_zero_top = NULL; + gcflag = false; + + // core collector routine //wait for init phase WAITFORGCPHASE(INITPHASE); @@ -310,12 +317,6 @@ void gc_collect(struct garbagelist * stackptr) { CACHEADAPT_PHASE_CLIENT(); - // invalidate all shared mem pointers - bamboo_cur_msp = NULL; - bamboo_smem_size = 0; - bamboo_smem_zero_top = NULL; - gcflag = false; - WAITFORGCPHASE(FINISHPHASE); GC_PRINTF("Finish gc! \n"); @@ -326,6 +327,12 @@ void gc_nocollect(struct garbagelist * stackptr) { // inform the master that this core is at a gc safe point and is ready to // do gc send_msg_4(STARTUPCORE,GCFINISHPRE,BAMBOO_NUM_OF_CORE,self_numsendobjs,self_numreceiveobjs); + + // invalidate all shared mem pointers + bamboo_cur_msp = NULL; + bamboo_smem_size = 0; + bamboo_smem_zero_top = NULL; + gcflag = false; WAITFORGCPHASE(INITPHASE); @@ -353,12 +360,6 @@ void gc_nocollect(struct garbagelist * stackptr) { CACHEADAPT_PHASE_CLIENT(); - // invalidate all shared mem pointers - bamboo_cur_msp = NULL; - bamboo_smem_size = 0; - bamboo_smem_zero_top = NULL; - - gcflag = false; WAITFORGCPHASE(FINISHPHASE); GC_PRINTF("Finish gc! \n"); @@ -545,7 +546,7 @@ bool gc(struct garbagelist * stackptr) { while(!gc_checkCoreStatus()) ; - pregccheck(); + //pregccheck(); GCPROFILE_START_MASTER(); GC_PRINTF("start gc! \n"); gc_master(stackptr); diff --git a/Robust/src/Runtime/mem.c b/Robust/src/Runtime/mem.c index d7eda8ee..80caa392 100644 --- a/Robust/src/Runtime/mem.c +++ b/Robust/src/Runtime/mem.c @@ -35,7 +35,7 @@ void * mycalloc_share(struct garbagelist * stackptr, int size) { return p; // no more global shared memory - if(hasgc < 5) { + if(hasgc < 30) { // start gc if(gcflag) { gc(stackptr);