File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ static inline PyObject* _Py_FROM_GC(PyGC_Head *gc) {
4343# define _PyGC_BITS_FINALIZED (2)
4444# define _PyGC_BITS_UNREACHABLE (4)
4545# define _PyGC_BITS_FROZEN (8)
46+ # define _PyGC_BITS_SHARED (16)
4647#endif
4748
4849/* True if the object is currently tracked by the GC. */
@@ -68,6 +69,19 @@ static inline int _PyObject_GC_MAY_BE_TRACKED(PyObject *obj) {
6869 return 1 ;
6970}
7071
72+ #ifdef Py_GIL_DISABLED
73+
74+ static inline int _PyObject_GC_IS_SHARED (PyObject * op ) {
75+ return (op -> ob_gc_bits & _PyGC_BITS_SHARED ) != 0 ;
76+ }
77+ #define _PyObject_GC_IS_SHARED (op ) _PyObject_GC_IS_SHARED(_Py_CAST(PyObject*, op))
78+
79+ static inline int _PyObject_GC_SET_SHARED (PyObject * op ) {
80+ return op -> ob_gc_bits |= _PyGC_BITS_SHARED ;
81+ }
82+ #define _PyObject_GC_SET_SHARED (op ) _PyObject_GC_SET_SHARED(_Py_CAST(PyObject*, op))
83+
84+ #endif
7185
7286/* Bit flags for _gc_prev */
7387/* Bit 0 is set when tp_finalize is called */
You can’t perform that action at this time.
0 commit comments