• Jeremy Hylton's avatar
    Fix ExtensionClass to work with Python debug builds. · 4b4986f8
    Jeremy Hylton authored
    When an object is initialized with null bytes, do not overwrite the
    PyObject_HEAD or PyObject_VAR_HEAD, which is initialized by Python
    core function, e.g. PyObject_NEW().
    
    New function EC_NewObject() is called for all object creations --
    replacing four calls to either PyObject_NEW() or PyObject_NEW_VAR().
    The new function initializes all the bytes that ExtensionClass is
    resposible for and INCREFs the base class.
    
    In ALLOC_FREE() macro, call _Py_NewReference() for objects allocated
    from the free list.
    4b4986f8
ExtensionClass.c 89.4 KB