◐ Shell
clean mode source ↗

gh-103743: Add PyUnstable_Object_GC_NewWithExtraData by jbradaric · Pull Request #103744 · python/cpython

@bedevere-bot mentioned this pull request

Apr 24, 2023

Eclips4

@jbradaric

@jbradaric jbradaric marked this pull request as ready for review

April 24, 2023 11:20

@jbradaric jbradaric changed the title [WIP] gh-103743: Add PyUnstable_Object_GC_NewWithExtraData gh-103743: Add PyUnstable_Object_GC_NewWithExtraData

Apr 24, 2023

ambv and others added 4 commits

April 25, 2023 02:34
That way it doesn't need the Py_LIMITED_API guard
This is a further workaround: this time for the fact that
we can't rely on tp_alloc, which zeroes the memory (including
memory for subclasses, like slots in the test) for normal classes.

For the test type, this means the instances aren't initialized twice
(once in PyUnstable_Object_GC_NewWithExtraData, once again with
PyObject_Init after zeroing). Initializing twice throws off the global
refcount total in debug builds.

erlend-aasland

Fix indentation and reword some parts to sound more natural.

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>

erlend-aasland

@jbradaric jbradaric deleted the jbradaric/obj-new-with-extra-data branch

May 2, 2023 12:01

carljm added a commit to carljm/cpython that referenced this pull request

May 2, 2023

carljm added a commit to carljm/cpython that referenced this pull request

May 2, 2023