bpo-35081: Make some _PyGC macros internal#10507
Conversation
UNTRACK and Track are opposite. |
Sorry, something went wrong.
Ooooops :-) I fixed my PR. I just noticed that _PyObject_GC_TRACK() _PyObject_GC_UNTRACK() macros are documented as "should not be used for extension modules". If I understand correctly, they macros have been broken in Python 3.7 since _PyObject_GC_TRACK() now requires Include/internal/pycore_pystate.h (called Include/internal/pystate.h in Python 3.7) to access I understand that my PR is not really backward incompatible, since the macros have been broken since Python 3.7 already. Moreover, they were never intended to be used outside CPython... right? |
Sorry, something went wrong.
* Move "GC" macros together: * PyObject_IS_GC() * _Py_AS_GC() * _PyObject_GC_IS_TRACKED() * _PyObject_GC_MAY_BE_TRACKED() * Mark other GC macros as internal (#ifdef Py_BUILD_CORE): * _PyGCHead_NEXT(g), _PyGCHead_SET_NEXT(g, p) * _PyGCHead_PREV(g), _PyGCHead_SET_PREV(g, p) * _PyGCHead_FINALIZED(g), _PyGCHead_SET_FINALIZED(g) * _PyGC_FINALIZED(o), _PyGC_SET_FINALIZED(o) * _PyObject_GC_TRACK(o), _PyObject_GC_UNTRACK(o) * _PyGC_PREV_MASK_FINALIZED * _PyGC_PREV_MASK_COLLECTING * _PyGC_PREV_SHIFT * _PyGC_PREV_MASK * Replace _PyGC_generation0 with _PyRuntime.gc.generation0 * _queuemodule.c: replace _PyObject_GC_UNTRACK() with with PyObject_GC_UnTrack() * Document that _PyObject_GC_TRACK() _PyObject_GC_UNTRACK() macros have been removed from the public C API.
|
I used git push --force a second time to include the full list of macros removed from the public API in the commit message:
|
Sorry, something went wrong.
|
Will this be ported to 3.7 too? The |
Sorry, something went wrong.
I'm not aware of this issue. Please open a new bug report at https://bugs.python.org/ |
Sorry, something went wrong.
|
Thanks for the quick reply @vstinner . Sure, I will open a new bug report. On the other hand, I found that you already mention here: https://bugs.python.org/issue35229 that the |
Sorry, something went wrong.
I'm not aware of that. Does it crash at runtime? In a module part of the stdlib or in a third-party C extension? If it's third-party, how is the C extension compiled? Well, please explain all these stuff in your bug report :-) I deprecated the functions in Python 3.6 doc: |
Sorry, something went wrong.
|
@vstinner please find here the details: |
Sorry, something went wrong.
Move "GC" macros together:
Mark other GC macros as internal (#ifdef Py_BUILD_CORE)
Replace _PyGC_generation0 with _PyRuntime.gc.generation0
_queuemodule.c: replace _PyObject_GC_UNTRACK()
with with PyObject_GC_Track()
https://bugs.python.org/issue35081