Skip to content

Commit 3e21ad1

Browse files
authored
bpo-35081: Move _PyGC_FINALIZED() back to C API (GH-10626)
Partially revert commit 1a6be91, move back PyGC API from the internal API to the C API: * _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) * _PyGC_PREV_MASK_FINALIZED * _PyGC_PREV_MASK_COLLECTING * _PyGC_PREV_SHIFT * _PyGC_PREV_MASK _PyObject_GC_TRACK(o) and _PyObject_GC_UNTRACK(o) remain in the internal API.
1 parent c8fe9cc commit 3e21ad1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Include/objimpl.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,7 @@ typedef struct {
288288
#define _PyObject_GC_MAY_BE_TRACKED(obj) \
289289
(PyObject_IS_GC(obj) && \
290290
(!PyTuple_CheckExact(obj) || _PyObject_GC_IS_TRACKED(obj)))
291-
#endif
292-
293291

294-
#if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_BUILTIN)
295292

296293
/* Bit flags for _gc_prev */
297294
/* Bit 0 is set when tp_finalize is called */
@@ -324,7 +321,10 @@ typedef struct {
324321
_PyGCHead_FINALIZED(_Py_AS_GC(o))
325322
#define _PyGC_SET_FINALIZED(o) \
326323
_PyGCHead_SET_FINALIZED(_Py_AS_GC(o))
324+
#endif /* !defined(Py_LIMITED_API) */
327325

326+
327+
#if defined(Py_BUILD_CORE) || defined(Py_BUILD_CORE_BUILTIN)
328328
/* Tell the GC to track this object.
329329
*
330330
* NB: While the object is tracked by the collector, it must be safe to call the

0 commit comments

Comments
 (0)