Skip to content

GH-124567: Reduce overhead of debug build for GC. Should help CI performance #126777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion Python/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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)
Expand Down
Loading