From: Alastair Bridgewater Date: Wed, 24 Apr 2013 17:13:50 +0000 (-0400) Subject: gencgc: Compute bytes_allocated correctly during dynamic space pickup. X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=ecca88e85c0f8bafea9be8c03cee793657168baf;p=sbcl.git gencgc: Compute bytes_allocated correctly during dynamic space pickup. * Rather than computing bytes_allocated based on the number of pages prior to the "alloc pointer" (really the heap high-water mark), accumulate it based on the number of ALLOCATED pages. * Fixes some lossage in write_generation_stats(), which seems to be the only place where this value is checked against reality. --- diff --git a/src/runtime/gencgc.c b/src/runtime/gencgc.c index f4ffd2f..ec21162 100644 --- a/src/runtime/gencgc.c +++ b/src/runtime/gencgc.c @@ -4130,6 +4130,9 @@ gencgc_pickup_dynamic(void) void *alloc_ptr = (void *)get_alloc_pointer(); lispobj *prev=(lispobj *)page_address(page); generation_index_t gen = PSEUDO_STATIC_GENERATION; + + bytes_allocated = 0; + do { lispobj *first,*ptr= (lispobj *)page_address(page); @@ -4143,6 +4146,8 @@ gencgc_pickup_dynamic(void) page_table[page].write_protected_cleared = 0; page_table[page].dont_move = 0; page_table[page].need_to_zero = 1; + + bytes_allocated += GENCGC_CARD_BYTES; } if (!gencgc_partial_pickup) { @@ -4158,8 +4163,7 @@ gencgc_pickup_dynamic(void) last_free_page = page; - generations[gen].bytes_allocated = npage_bytes(page); - bytes_allocated = npage_bytes(page); + generations[gen].bytes_allocated = bytes_allocated; gc_alloc_update_all_page_tables(); write_protect_generation_pages(gen);