summaryrefslogtreecommitdiffstats
path: root/Python/gc.c
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2024-11-15 08:59:01 (GMT)
committerGitHub <noreply@github.com>2024-11-15 08:59:01 (GMT)
commitc0f045f7fd3bb7ccf9828f4bfad55347d097fd41 (patch)
tree3344fe811c8567c6618d515f6d95d452fb7a4c21 /Python/gc.c
parentd9e251223e8314ca726fc0be8b834362184b0aad (diff)
downloadcpython-c0f045f7fd3bb7ccf9828f4bfad55347d097fd41.zip
cpython-c0f045f7fd3bb7ccf9828f4bfad55347d097fd41.tar.gz
cpython-c0f045f7fd3bb7ccf9828f4bfad55347d097fd41.tar.bz2
GH-124567: Reduce overhead of debug build for GC. Should help CI performance (GH-126777)
Diffstat (limited to 'Python/gc.c')
-rw-r--r--Python/gc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/Python/gc.c b/Python/gc.c
index 028657e..fe81ca5 100644
--- a/Python/gc.c
+++ b/Python/gc.c
@@ -23,6 +23,10 @@ typedef struct _gc_runtime_state GCState;
# define GC_DEBUG
#endif
+// Define this when debugging the GC
+// #define GC_EXTRA_DEBUG
+
+
#define GC_NEXT _PyGCHead_NEXT
#define GC_PREV _PyGCHead_PREV
@@ -421,6 +425,11 @@ validate_list(PyGC_Head *head, enum flagstates flags)
assert(prev == GC_PREV(head));
}
+#else
+#define validate_list(x, y) do{}while(0)
+#endif
+
+#ifdef GC_EXTRA_DEBUG
static void
validate_old(GCState *gcstate)
{
@@ -464,7 +473,6 @@ gc_list_validate_space(PyGC_Head *head, int space) {
}
#else
-#define validate_list(x, y) do{}while(0)
#define validate_old(g) do{}while(0)
#define validate_consistent_old_space(l) do{}while(0)
#define gc_list_validate_space(l, s) do{}while(0)