Skip to content

Commit

Permalink
Silence compiler warnings in gc.c (python#117422)
Browse files Browse the repository at this point in the history
  • Loading branch information
gvanrossum committed Apr 1, 2024
1 parent 179869a commit ddf814d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Python/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1317,6 +1317,7 @@ gc_collect_young(PyThreadState *tstate,
survivor_count++;
}
}
(void)survivor_count; // Silence compiler warning
gc_list_merge(&survivors, visited);
validate_old(gcstate);
gcstate->young.count = 0;
Expand All @@ -1329,12 +1330,14 @@ gc_collect_young(PyThreadState *tstate,
add_stats(gcstate, 0, stats);
}

#ifndef NDEBUG
static inline int
IS_IN_VISITED(PyGC_Head *gc, int visited_space)
{
assert(visited_space == 0 || flip_old_space(visited_space) == 0);
return gc_old_space(gc) == visited_space;
}
#endif

struct container_and_flag {
PyGC_Head *container;
Expand Down

0 comments on commit ddf814d

Please sign in to comment.