mirror of
https://github.com/python/cpython.git
synced 2024-11-28 16:45:42 +01:00
4b63cd170e
The `PyStructSequence` destructor would crash if it was deallocated after its type's dictionary was cleared by the GC, because it couldn't compute the "real size" of the instance. This could occur with relatively straightforward code in the free-threaded build or with a reference cycle involving the type in the default build, due to differing orders in which `tp_clear()` was called. Account for the non-sequence fields in `tp_basicsize` and use that, along with `Py_SIZE()`, to compute the "real" size of a `PyStructSequence` in the dealloc function. This avoids the accesses to the type's dictionary during dealloc, which were unsafe. |
||
---|---|---|
.. | ||
clinic | ||
mimalloc | ||
stringlib | ||
abstract.c | ||
boolobject.c | ||
bytearrayobject.c | ||
bytes_methods.c | ||
bytesobject.c | ||
call.c | ||
capsule.c | ||
cellobject.c | ||
classobject.c | ||
codeobject.c | ||
complexobject.c | ||
descrobject.c | ||
dictnotes.txt | ||
dictobject.c | ||
enumobject.c | ||
exceptions.c | ||
fileobject.c | ||
floatobject.c | ||
frameobject.c | ||
funcobject.c | ||
genericaliasobject.c | ||
genobject.c | ||
iterobject.c | ||
listobject.c | ||
listsort.txt | ||
lnotab_notes.txt | ||
longobject.c | ||
memoryobject.c | ||
methodobject.c | ||
moduleobject.c | ||
namespaceobject.c | ||
object_layout_312.gv | ||
object_layout_312.png | ||
object_layout_313.gv | ||
object_layout_313.png | ||
object_layout_full_312.gv | ||
object_layout_full_312.png | ||
object_layout_full_313.gv | ||
object_layout_full_313.png | ||
object_layout.md | ||
object.c | ||
obmalloc.c | ||
odictobject.c | ||
picklebufobject.c | ||
rangeobject.c | ||
README | ||
setobject.c | ||
sliceobject.c | ||
structseq.c | ||
tupleobject.c | ||
typeobject.c | ||
typeslots.inc | ||
typeslots.py | ||
typevarobject.c | ||
unicodectype.c | ||
unicodeobject.c | ||
unicodetype_db.h | ||
unionobject.c | ||
weakrefobject.c |
Source files for various builtin objects