• Kevin Modzelewski's avatar
    Change our GC handling of weakrefs · 930a382e
    Kevin Modzelewski authored
    For weakly-referenced objects that are garbage, we end up freeing their
    attributes within that collection (assuming they are garbage as well).
    This means that these objects are in a state that is not quite dead (we
    don't want to allocate anything else in that space and clobber their
    weakreflist), and not quite alive (their attributes point to garbage
    memory).
    
    So, change the handling to finish looking at those objects in the collection
    that they become garbage, and then free them to make them properly dead.
    
    weakrefs-handling is unavoidably reentrant, but now we only have to worry
    about fully-dead (the referents) or fully-alive (the weakrefs) objects.
    930a382e
heap.cpp 24.9 KB