Support the use of the managed pre-header in builtin classes. #95707
Labels
3.12
interpreter-core
(Objects, Python, Grammar, and Parser dirs)
performance
Performance or resource usage
type-feature
A feature request or enhancement
markshannon commentedAug 5, 2022
•
edited
Currently
Py_TPFLAGS_MANAGED_DICT
is an internal-only flag, in fact setting in third-party code is likely to lead to a crash.We would like to expose it, and a weakref equivalent
Py_TPFLAGS_MANAGED_WEAKREFS
to allow builtin classes to take advantage of compact object layout.Compact layout uses less memory, performs better and allow more robust subclassing. So everyone should be able to use it.
Py_TPFLAGS_MANAGED_DICT
is usedPy_TPFLAGS_MANAGED_WEAKREFS
tp_dictoffset
andtp_weakreflist
The text was updated successfully, but these errors were encountered: