From 58c92bad230b8c088b6b5b1232b1a99dade810a9 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Mon, 20 Jun 2011 10:22:44 +0000 Subject: [PATCH] only call mark once... --- Robust/src/Runtime/bamboo/multicoregarbage.c | 12 +++--------- Robust/src/Runtime/bamboo/multicoregcmark.c | 11 +++++------ Robust/src/Runtime/bamboo/multicoregcmark.h | 2 +- 3 files changed, 9 insertions(+), 16 deletions(-) diff --git a/Robust/src/Runtime/bamboo/multicoregarbage.c b/Robust/src/Runtime/bamboo/multicoregarbage.c index c2172ef3..a3b20e5f 100644 --- a/Robust/src/Runtime/bamboo/multicoregarbage.c +++ b/Robust/src/Runtime/bamboo/multicoregarbage.c @@ -288,7 +288,7 @@ void gc_collect(struct garbagelist * stackptr) { WAITFORGCPHASE(MARKPHASE); GC_PRINTF("Start mark phase\n"); - mark(true, stackptr); + mark(stackptr); GC_PRINTF("Finish mark phase, start compact phase\n"); compact(); GC_PRINTF("Finish compact phase\n"); @@ -330,7 +330,7 @@ void gc_nocollect(struct garbagelist * stackptr) { WAITFORGCPHASE(MARKPHASE); GC_PRINTF("Start mark phase\n"); - mark(true, stackptr); + mark(stackptr); GC_PRINTF("Finish mark phase, wait for flush\n"); // non-gc core collector routine @@ -355,19 +355,13 @@ void gc_nocollect(struct garbagelist * stackptr) { } void master_mark(struct garbagelist *stackptr) { - bool isfirst = true; GC_PRINTF("Start mark phase \n"); GC_SEND_MSG_1_TO_CLIENT(GCSTART); gc_status_info.gcphase = MARKPHASE; // mark phase - while(MARKPHASE == gc_status_info.gcphase) { - mark(isfirst, stackptr); - isfirst=false; - // check gcstatus - checkMarkStatus(); - } + mark(stackptr); } void master_getlargeobjs() { diff --git a/Robust/src/Runtime/bamboo/multicoregcmark.c b/Robust/src/Runtime/bamboo/multicoregcmark.c index 18866c4a..72ff2ec9 100644 --- a/Robust/src/Runtime/bamboo/multicoregcmark.c +++ b/Robust/src/Runtime/bamboo/multicoregcmark.c @@ -243,11 +243,10 @@ INLINE void scanPtrsInObj(void * ptr, int type) { } } -void mark(bool isfirst, struct garbagelist * stackptr) { - if(isfirst) { - // enqueue root objs - tomark(stackptr); - } +void mark(struct garbagelist * stackptr) { + // enqueue root objs + tomark(stackptr); + unsigned int isize = 0; bool sendStall = false; // mark phase @@ -293,7 +292,7 @@ void mark(bool isfirst, struct garbagelist * stackptr) { } if(BAMBOO_NUM_OF_CORE == STARTUPCORE) - return; + checkMarkStatus(); } BAMBOO_CACHE_MF(); diff --git a/Robust/src/Runtime/bamboo/multicoregcmark.h b/Robust/src/Runtime/bamboo/multicoregcmark.h index 1dac20a8..2d91b93e 100644 --- a/Robust/src/Runtime/bamboo/multicoregcmark.h +++ b/Robust/src/Runtime/bamboo/multicoregcmark.h @@ -10,7 +10,7 @@ INLINE void markgarbagelist(struct garbagelist * listptr); INLINE void tomark(struct garbagelist * stackptr); INLINE void scanPtrsInObj(void * ptr, int type); void markObj(void * objptr); -void mark(bool isfirst, struct garbagelist * stackptr); +void mark(struct garbagelist * stackptr); #endif // MULTICORE_GC #endif // BAMBOO_MULTICORE_GC_MARK_H -- 2.34.1