• Kevin Modzelewski's avatar
    Switch the attributes array to be a PRECISE array · 97d43471
    Kevin Modzelewski authored
    Previously it was UNTRACKED and the object's gcHandler would scan
    it if necessary.  This worked ok most of the time but caused issues
    when we subclass from an extension class: the memory for those classes
    are allocated conservatively, which meant that a gc handler wasn't
    called.
    
    One potential approach would be to allocate extension objects as PYTHON
    allocations but with a gcHandler that both scans conservatively and also
    knows about the attrs array.  But for now it seems easier to allocate the
    attrs array as a PRECISE array (which means it gets scanned) rather than
    UNTRACKED, since it will automatically get picked up (and provide better
    gc safety in general and remove one of the odd gc cases).
    
    I didn't realize that we weren't using PRECISE at all and that it wasn't
    completely working, so this change also required setting kind_data for
    PRECISE allocations, and fixing the way we keep this updated during
    gc_realloc.
    97d43471
heap.h 16.5 KB