[issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC

2021-09-21 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC

2021-06-30 Thread STINNER Victor
STINNER Victor added the comment: New changeset 818628c2da99ba0376313971816d472c65c9a9fc by Victor Stinner in branch 'main': bpo-44531: Add _PyType_AllocNoTrack() function (GH-26947) https://github.com/python/cpython/commit/818628c2da99ba0376313971816d472c65c9a9fc --

[issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC

2021-06-29 Thread STINNER Victor
STINNER Victor added the comment: For the background of this issue, please see bpo-38392: https://bugs.python.org/issue38392#msg354074 -- ___ Python tracker ___

[issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC

2021-06-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > About subclasses, I'm not sure if it's safe to call the traverse function if > a subclass overrides it and visits its own member which are not in the > built-in type (like dict or tuple). Technically the traverse should only call visit on the

[issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC

2021-06-29 Thread STINNER Victor
STINNER Victor added the comment: > How is that going to help third party extensions and subclasses? It doesn't solve bpo-40142 issue for third party extensions. About subclasses, I'm not sure if it's safe to call the traverse function if a subclass overrides it and visits its own member

[issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC

2021-06-29 Thread STINNER Victor
STINNER Victor added the comment: New changeset 823460daa9fab3d0cf00ec553d1e35635ef73d40 by Victor Stinner in branch 'main': bpo-44531: Fix type_repr() if tp_name is NULL (GH-26948) https://github.com/python/cpython/commit/823460daa9fab3d0cf00ec553d1e35635ef73d40 --

[issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC

2021-06-29 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: > Anyway, I propose to add a new _PyType_AllocNoTrack() function which > allocates memory without tracking the newly allocated object directly in the > GC. How is that going to help third party extensions and subclasses? -- nosy: +pablogsal

[issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC

2021-06-28 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +25515 pull_request: https://github.com/python/cpython/pull/26948 ___ Python tracker ___

[issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC

2021-06-28 Thread STINNER Victor
STINNER Victor added the comment: In bpo-40142, I tried to modify _PyObject_GC_TRACK() to visit the object before tracking it, as done by PyObject_GC_Track(). Problem: PyType_GenericAlloc() cannot traverse the object since the object members are not initialized yet. For example,

[issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC

2021-06-28 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +25514 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26947 ___ Python tracker ___

[issue44531] Add _PyType_AllocNoTrack() function: allocate without tracking in the GC

2021-06-28 Thread STINNER Victor
New submission from STINNER Victor : The PyType_GenericAlloc() function tracks the newly created object in the garbage collector (GC) as soon as memory is initialized, but before all object members are initialized. If a GC collection happens before the object is fully initialized, the