Skip to content

Commit 78cd7ae

Browse files
pablogsalJake Taylor
authored andcommitted
bpo-38437: Activate GC_DEBUG when PY_DEBUG is set (pythonGH-16707)
1 parent c6a147e commit 78cd7ae

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Activate the ``GC_DEBUG`` macro for debug builds of the interpreter (when
2+
``Py_DEBUG`` is set). Patch by Pablo Galindo.

Modules/gcmodule.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ module gc
3737
[clinic start generated code]*/
3838
/*[clinic end generated code: output=da39a3ee5e6b4b0d input=b5c9690ecc842d79]*/
3939

40-
#define GC_DEBUG (0) /* Enable more asserts */
40+
41+
#ifdef Py_DEBUG
42+
# define GC_DEBUG
43+
#endif
4144

4245
#define GC_NEXT _PyGCHead_NEXT
4346
#define GC_PREV _PyGCHead_PREV
@@ -316,7 +319,7 @@ append_objects(PyObject *py_list, PyGC_Head *gc_list)
316319
return 0;
317320
}
318321

319-
#if GC_DEBUG
322+
#ifdef GC_DEBUG
320323
// validate_list checks list consistency. And it works as document
321324
// describing when expected_mask is set / unset.
322325
static void

0 commit comments

Comments
 (0)