Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 582179c

Browse files
committed
GC shared doc and tweak
1 parent 482e1a2 commit 582179c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Include/internal/pycore_gc.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,16 @@ static inline int _PyObject_GC_MAY_BE_TRACKED(PyObject *obj) {
7171

7272
#ifdef Py_GIL_DISABLED
7373

74+
/* True if an object is shared between multiple threads and
75+
* needs special purpose when freeing to do the possibility
76+
* of in-flight lock-free reads occuring */
7477
static inline int _PyObject_GC_IS_SHARED(PyObject *op) {
7578
return (op->ob_gc_bits & _PyGC_BITS_SHARED) != 0;
7679
}
7780
#define _PyObject_GC_IS_SHARED(op) _PyObject_GC_IS_SHARED(_Py_CAST(PyObject*, op))
7881

79-
static inline int _PyObject_GC_SET_SHARED(PyObject *op) {
80-
return op->ob_gc_bits |= _PyGC_BITS_SHARED;
82+
static inline void _PyObject_GC_SET_SHARED(PyObject *op) {
83+
op->ob_gc_bits |= _PyGC_BITS_SHARED;
8184
}
8285
#define _PyObject_GC_SET_SHARED(op) _PyObject_GC_SET_SHARED(_Py_CAST(PyObject*, op))
8386

0 commit comments

Comments
 (0)