bpo-38437: Activate GC_DEBUG when PY_DEBUG is set (GH-16707)

This commit is contained in:
Pablo Galindo 2019-10-10 22:45:17 +01:00 committed by GitHub
parent 72bbd2a2e3
commit 320dd504dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,2 @@
Activate the ``GC_DEBUG`` macro for debug builds of the interpreter (when
``Py_DEBUG`` is set). Patch by Pablo Galindo.

View File

@ -37,7 +37,10 @@ module gc
[clinic start generated code]*/
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=b5c9690ecc842d79]*/
#define GC_DEBUG (0) /* Enable more asserts */
#ifdef Py_DEBUG
# define GC_DEBUG
#endif
#define GC_NEXT _PyGCHead_NEXT
#define GC_PREV _PyGCHead_PREV
@ -316,7 +319,7 @@ append_objects(PyObject *py_list, PyGC_Head *gc_list)
return 0;
}
#if GC_DEBUG
#ifdef GC_DEBUG
// validate_list checks list consistency. And it works as document
// describing when expected_mask is set / unset.
static void