]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-45947: Place dict and values pointer at fixed (negative) offset just before GC...
authorMark Shannon <mark@hotpy.org>
Tue, 7 Dec 2021 16:02:53 +0000 (16:02 +0000)
committerGitHub <noreply@github.com>
Tue, 7 Dec 2021 16:02:53 +0000 (16:02 +0000)
commit8319114feedd2a5b77378bba24eb9fb2689c5033
treeb96bfa2c7b8d36124b713170f421f653360a4b5c
parentc7e7a4b969b5728d4b4f3c59bf98e1e830d5c6d6
bpo-45947: Place dict and values pointer at fixed (negative) offset just before GC header. (GH-29879)

* Place __dict__ immediately before GC header for plain Python objects.

* Fix up lazy dict creation logic to use managed dict pointers.

* Manage values pointer, placing them directly before managed dict pointers.

* Convert hint-based load/store attr specialization target managed dict classes.

* Specialize LOAD_METHOD for managed dict objects.

* Remove unsafe _PyObject_GC_Calloc function.

* Remove unsafe _PyObject_GC_Malloc() function.

* Add comment explaning use of Py_TPFLAGS_MANAGED_DICT.
19 files changed:
Include/cpython/object.h
Include/cpython/objimpl.h
Include/internal/pycore_object.h
Include/object.h
Lib/test/test_stable_abi_ctypes.py
Lib/test/test_sys.py
Misc/NEWS.d/next/Core and Builtins/2021-12-01-14-06-36.bpo-45947.1XPPm_.rst [new file with mode: 0644]
Misc/stable_abi.txt
Modules/_testcapimodule.c
Modules/gcmodule.c
Objects/dictobject.c
Objects/exceptions.c
Objects/object.c
Objects/typeobject.c
PC/python3dll.c
Python/ceval.c
Python/specialize.c
Python/sysmodule.c
Tools/gdb/libpython.py