diff options
author | INADA Naoki <methane@users.noreply.github.com> | 2018-05-17 02:07:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-17 02:07:21 (GMT) |
commit | d852142cd728f45372ba6137bd87e29ba7b5b4d2 (patch) | |
tree | 7540147fed0705ddc873facf2b93774db4f39cc1 /Objects | |
parent | e5f41d2f1e0b8b8e61d5fa427c19bd1ea90fd9a3 (diff) | |
download | cpython-d852142cd728f45372ba6137bd87e29ba7b5b4d2.zip cpython-d852142cd728f45372ba6137bd87e29ba7b5b4d2.tar.gz cpython-d852142cd728f45372ba6137bd87e29ba7b5b4d2.tar.bz2 |
Replace _PyGC_REFS macros with higher level macros (GH-6852)
Only gcmodule.c uses _PyGC_REFS* macros now.
This makes easy to read GC code.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/object.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Objects/object.c b/Objects/object.c index 6532c3b..3eb4810 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -316,9 +316,7 @@ PyObject_CallFinalizerFromDealloc(PyObject *self) _Py_NewReference(self); self->ob_refcnt = refcnt; - if (PyType_IS_GC(Py_TYPE(self))) { - assert(_PyGC_REFS(self) != _PyGC_REFS_UNTRACKED); - } + assert(!PyType_IS_GC(Py_TYPE(self)) || _PyObject_GC_IS_TRACKED(self)); /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so * we need to undo that. */ _Py_DEC_REFTOTAL; @@ -2095,7 +2093,7 @@ void _PyTrash_deposit_object(PyObject *op) { assert(PyObject_IS_GC(op)); - assert(_PyGC_REFS(op) == _PyGC_REFS_UNTRACKED); + assert(!_PyObject_GC_IS_TRACKED(op)); assert(op->ob_refcnt == 0); _Py_AS_GC(op)->gc.gc_prev = (PyGC_Head *)_PyRuntime.gc.trash_delete_later; _PyRuntime.gc.trash_delete_later = op; @@ -2107,7 +2105,7 @@ _PyTrash_thread_deposit_object(PyObject *op) { PyThreadState *tstate = PyThreadState_GET(); assert(PyObject_IS_GC(op)); - assert(_PyGC_REFS(op) == _PyGC_REFS_UNTRACKED); + assert(!_PyObject_GC_IS_TRACKED(op)); assert(op->ob_refcnt == 0); _Py_AS_GC(op)->gc.gc_prev = (PyGC_Head *) tstate->trash_delete_later; tstate->trash_delete_later = op; |