]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-44531: Add _PyType_AllocNoTrack() function (GH-26947)
authorVictor Stinner <vstinner@python.org>
Thu, 1 Jul 2021 00:30:46 +0000 (02:30 +0200)
committerGitHub <noreply@github.com>
Thu, 1 Jul 2021 00:30:46 +0000 (02:30 +0200)
commit818628c2da99ba0376313971816d472c65c9a9fc
tree60d50461785e6ddc16f35a047ece9dc83890eef8
parent1b28187a0e3e914ee48de8032cbba0a965dd5563
bpo-44531: Add _PyType_AllocNoTrack() function (GH-26947)

Add an internal _PyType_AllocNoTrack() function to allocate an object
without tracking it in the GC.

Modify dict_new() to use _PyType_AllocNoTrack(): dict subclasses are
now only tracked once all PyDictObject members are initialized.
Calling _PyObject_GC_UNTRACK() is no longer needed for the dict type.

Similar change in tuple_subtype_new() for tuple subclasses.

Replace tuple_gc_track() with _PyObject_GC_TRACK().
Include/internal/pycore_object.h
Objects/dictobject.c
Objects/tupleobject.c
Objects/typeobject.c