cpython private

To start a new build commit change to repository or click New build button.
[3.8] bpo-37879: Suppress subtype_dealloc decref when base type is a C heap type (GH-15323)
The instance destructor for a type is responsible for preparing an instance for deallocation by decrementing the reference counts of its referents. If an instance belongs to a heap type, the type object of an instance has its reference count decremented while for static types, which are permanently allocated, the type object is unaffected by the instance destructor. Previously, the default instance destructor searched the class hierarchy for an inherited instance destructor and, if present, would invoke it. Then, if the instance type is a heap type, it would decrement the reference count of that heap type. However, this could result in the premature destruction of a type because the inherited instance destructor should have already decremented the reference count of the type object. This change avoids the premature destruction of the type object by suppressing the decrement of its reference count when an inherited, non-default instance destructor has been invoked. Finally, an assertion on the Py_SIZE of a type was deleted. Heap types have a non zero size, making this into an incorrect assertion. https://github.com/python/cpython/pull/15323. (cherry picked from commit ff023ed36ea260ab64be5895f1f1f087c798987a) Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
3.8build43333
6 years ago by Eddie Elizondo (committed by Petr Viktorin)
6 years ago in 16 min 26 sec
16 min 26 sec
Rendering console...
Log is empty.