diff --git a/src/gc/alloc_resources.c b/src/gc/alloc_resources.c index 6930bb8..4468512 100644 --- a/src/gc/alloc_resources.c +++ b/src/gc/alloc_resources.c @@ -724,8 +724,7 @@ free_old_mem_blocks( else { /* Note that we don't have it any more */ mem_pools->memory_allocated -= cur_block->size; - mem_pools->memory_used -= - cur_block->size - cur_block->free - cur_block->freed; + mem_pools->memory_used -= cur_block->size - cur_block->free; /* We know the pool body and pool header are a single chunk, so * this is enough to get rid of 'em both */ diff --git a/src/gc/gc_ms.c b/src/gc/gc_ms.c index 08b2cce..cc9aac2 100644 --- a/src/gc/gc_ms.c +++ b/src/gc/gc_ms.c @@ -1268,7 +1268,6 @@ gc_ms_reallocate_string_storage(PARROT_INTERP, ARGMOD(STRING *str), /* Decrease usage */ PARROT_ASSERT(Buffer_pool(str)); Buffer_pool(str)->freed += old_size; - interp->mem_pools->memory_used -= old_size; /* copy mem from strstart, *not* bufstart */ oldmem = str->strstart; diff --git a/src/gc/mark_sweep.c b/src/gc/mark_sweep.c index 92bbb3c..b6baba6 100644 --- a/src/gc/mark_sweep.c +++ b/src/gc/mark_sweep.c @@ -32,13 +32,11 @@ throughout the rest of Parrot. /* Don't modify between HEADERIZER BEGIN / HEADERIZER END. Your changes will be lost. */ static void free_buffer(SHIM_INTERP, - ARGMOD(Memory_Pools *mem_pools), + SHIM(Memory_Pools *mem_pools), ARGMOD(Fixed_Size_Pool *pool), ARGMOD(Buffer *b)) - __attribute__nonnull__(2) __attribute__nonnull__(3) __attribute__nonnull__(4) - FUNC_MODIFIES(*mem_pools) FUNC_MODIFIES(*pool) FUNC_MODIFIES(*b); @@ -80,8 +78,7 @@ static Fixed_Size_Pool * new_string_pool(PARROT_INTERP, FUNC_MODIFIES(*mem_pools); #define ASSERT_ARGS_free_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ - PARROT_ASSERT_ARG(mem_pools) \ - , PARROT_ASSERT_ARG(pool) \ + PARROT_ASSERT_ARG(pool) \ , PARROT_ASSERT_ARG(b)) #define ASSERT_ARGS_free_pmc_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ PARROT_ASSERT_ARG(interp) \ @@ -668,7 +665,7 @@ reuse later. static void free_buffer(SHIM_INTERP, - ARGMOD(Memory_Pools *mem_pools), + SHIM(Memory_Pools *mem_pools), ARGMOD(Fixed_Size_Pool *pool), ARGMOD(Buffer *b)) { @@ -693,9 +690,7 @@ free_buffer(SHIM_INTERP, /* We can have shared buffers. Don't count them (yet) */ if (!(*buffer_flags & Buffer_shared_FLAG)) { - size_t size = ALIGNED_STRING_SIZE(Buffer_buflen(b)); - block->freed += size; - mem_pools->memory_used -= size; + block->freed += ALIGNED_STRING_SIZE(Buffer_buflen(b)); } }