From 40f9467c072eb09d23ee38a4af6009c1ee3e3709 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 18 Sep 2015 12:26:32 -0600 Subject: [PATCH] count phantom bytes as regular allocation The original idea was to count phantom bytes as "administrative overhead", but issues discussed in #962 identified problems with that idea. Finish shifting the accounting to treat phantom bytes as payload allocation. --- racket/src/racket/gc2/newgc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/racket/src/racket/gc2/newgc.c b/racket/src/racket/gc2/newgc.c index b4afb84306..5e936c0ec5 100644 --- a/racket/src/racket/gc2/newgc.c +++ b/racket/src/racket/gc2/newgc.c @@ -5027,8 +5027,8 @@ static void garbage_collect(NewGC *gc, int force_full, int no_full, int switchin int next_gc_full; - old_mem_use = gc->memory_in_use; - old_gen0 = gc->gen0.current_size; + old_mem_use = gc->memory_in_use; /* includes gc->phantom_count */ + old_gen0 = gc->gen0.current_size + gc->gen0_phantom_count; old_mem_allocated = mmu_memory_allocated(gc->mmu) + gc->phantom_count + gc->gen0_phantom_count; TIME_DECLS(); @@ -5272,8 +5272,8 @@ static void garbage_collect(NewGC *gc, int force_full, int no_full, int switchin lmi->full = gc->gc_full, lmi->pre_used = old_mem_use + old_gen0; lmi->post_used = gc->memory_in_use; - lmi->pre_admin = old_mem_allocated+gc->phantom_count; - lmi->post_admin = mmu_memory_allocated(gc->mmu); + lmi->pre_admin = old_mem_allocated; + lmi->post_admin = mmu_memory_allocated(gc->mmu)+gc->phantom_count; } GC_propagate_hierarchy_memory_use(); #endif