Skip to content

Commit abc7a52

Browse files
markshannonpicnixz
authored andcommitted
pythonGH-124567: Reduce overhead of debug build for GC. Should help CI performance (pythonGH-126777)
1 parent f4475b0 commit abc7a52

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Python/gc.c

+9-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ typedef struct _gc_runtime_state GCState;
2323
# define GC_DEBUG
2424
#endif
2525

26+
// Define this when debugging the GC
27+
// #define GC_EXTRA_DEBUG
28+
29+
2630
#define GC_NEXT _PyGCHead_NEXT
2731
#define GC_PREV _PyGCHead_PREV
2832

@@ -421,6 +425,11 @@ validate_list(PyGC_Head *head, enum flagstates flags)
421425
assert(prev == GC_PREV(head));
422426
}
423427

428+
#else
429+
#define validate_list(x, y) do{}while(0)
430+
#endif
431+
432+
#ifdef GC_EXTRA_DEBUG
424433
static void
425434
validate_old(GCState *gcstate)
426435
{
@@ -464,7 +473,6 @@ gc_list_validate_space(PyGC_Head *head, int space) {
464473
}
465474

466475
#else
467-
#define validate_list(x, y) do{}while(0)
468476
#define validate_old(g) do{}while(0)
469477
#define validate_consistent_old_space(l) do{}while(0)
470478
#define gc_list_validate_space(l, s) do{}while(0)

0 commit comments

Comments
 (0)