Skip to content
Snippets Groups Projects
  • Dave Hylands's avatar
    7f3c0d1e
    py: Clear finalizer flag when calling gc_free. · 7f3c0d1e
    Dave Hylands authored
    Currently, the only place that clears the bit is in gc_collect.
    So if a block with a finalizer is allocated, and subsequently
    freed, and then the block is reallocated with no finalizer then
    the bit remains set.
    
    This could also be fixed by having gc_alloc clear the bit, but
    I'm pretty sure that free is called way less than alloc, so doing
    it in free is more efficient.
    7f3c0d1e
    History
    py: Clear finalizer flag when calling gc_free.
    Dave Hylands authored
    Currently, the only place that clears the bit is in gc_collect.
    So if a block with a finalizer is allocated, and subsequently
    freed, and then the block is reallocated with no finalizer then
    the bit remains set.
    
    This could also be fixed by having gc_alloc clear the bit, but
    I'm pretty sure that free is called way less than alloc, so doing
    it in free is more efficient.