• Kevin Modzelewski's avatar
    Update isValidGCObject to check the allocation kind · d48961f6
    Kevin Modzelewski authored
    ie make sure both that it's a valid allocation, but also that
    it will have Python destructor semantics applied when it is freed
    (as opposed to, say, STLCompatAllocator-allocated memory).
    
    This is to make sure that extension modules don't use a different
    allocation routine than we expected.
    
    There are only a few specialized places that I could find that we
    actually want the old-behavior; in dump(), and in PyObject_Init right
    before we call setIsPythonObject.  So for those cases, add a new
    isValidGCMemory call that doesn't do the allocation-kind check.
    d48961f6
collector.cpp 13.9 KB