Ticket #1737: gc-timing-fix.diff

File gc-timing-fix.diff, 2.8 KB (added by nwellnhof, 4 years ago)
  • src/gc/alloc_resources.c

    diff --git a/src/gc/alloc_resources.c b/src/gc/alloc_resources.c
    index 6930bb8..4468512 100644
    a b  
    724724        else { 
    725725            /* Note that we don't have it any more */ 
    726726            mem_pools->memory_allocated -= cur_block->size; 
    727             mem_pools->memory_used -= 
    728                 cur_block->size - cur_block->free - cur_block->freed; 
     727            mem_pools->memory_used -= cur_block->size - cur_block->free; 
    729728 
    730729            /* We know the pool body and pool header are a single chunk, so 
    731730             * this is enough to get rid of 'em both */ 
  • src/gc/gc_ms.c

    diff --git a/src/gc/gc_ms.c b/src/gc/gc_ms.c
    index 08b2cce..cc9aac2 100644
    a b  
    12681268    /* Decrease usage */ 
    12691269    PARROT_ASSERT(Buffer_pool(str)); 
    12701270    Buffer_pool(str)->freed += old_size; 
    1271     interp->mem_pools->memory_used -= old_size; 
    12721271 
    12731272    /* copy mem from strstart, *not* bufstart */ 
    12741273    oldmem             = str->strstart; 
  • src/gc/mark_sweep.c

    diff --git a/src/gc/mark_sweep.c b/src/gc/mark_sweep.c
    index 92bbb3c..b6baba6 100644
    a b  
    3232/* Don't modify between HEADERIZER BEGIN / HEADERIZER END.  Your changes will be lost. */ 
    3333 
    3434static void free_buffer(SHIM_INTERP, 
    35     ARGMOD(Memory_Pools *mem_pools), 
     35    SHIM(Memory_Pools *mem_pools), 
    3636    ARGMOD(Fixed_Size_Pool *pool), 
    3737    ARGMOD(Buffer *b)) 
    38         __attribute__nonnull__(2) 
    3938        __attribute__nonnull__(3) 
    4039        __attribute__nonnull__(4) 
    41         FUNC_MODIFIES(*mem_pools) 
    4240        FUNC_MODIFIES(*pool) 
    4341        FUNC_MODIFIES(*b); 
    4442 
     
    8078        FUNC_MODIFIES(*mem_pools); 
    8179 
    8280#define ASSERT_ARGS_free_buffer __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 
    83        PARROT_ASSERT_ARG(mem_pools) \ 
    84     , PARROT_ASSERT_ARG(pool) \ 
     81       PARROT_ASSERT_ARG(pool) \ 
    8582    , PARROT_ASSERT_ARG(b)) 
    8683#define ASSERT_ARGS_free_pmc_in_pool __attribute__unused__ int _ASSERT_ARGS_CHECK = (\ 
    8784       PARROT_ASSERT_ARG(interp) \ 
     
    668665 
    669666static void 
    670667free_buffer(SHIM_INTERP, 
    671         ARGMOD(Memory_Pools *mem_pools), 
     668        SHIM(Memory_Pools *mem_pools), 
    672669        ARGMOD(Fixed_Size_Pool *pool), 
    673670        ARGMOD(Buffer *b)) 
    674671{ 
     
    693690 
    694691            /* We can have shared buffers. Don't count them (yet) */ 
    695692            if (!(*buffer_flags & Buffer_shared_FLAG)) { 
    696                 size_t size = ALIGNED_STRING_SIZE(Buffer_buflen(b)); 
    697                 block->freed += size; 
    698                 mem_pools->memory_used -= size; 
     693                block->freed  += ALIGNED_STRING_SIZE(Buffer_buflen(b)); 
    699694            } 
    700695 
    701696        }