Skip to content

Commit e60c802

Browse files
Statically initialize PyInterpreterState.gc.enabled.
1 parent 5cc2c41 commit e60c802

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

Include/internal/pycore_runtime_init.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ extern "C" {
3939
.ceval = { \
4040
.recursion_limit = Py_DEFAULT_RECURSION_LIMIT, \
4141
}, \
42+
.gc = { \
43+
.enabled = 1, /* automatic collection enabled? */ \
44+
}, \
4245
._initial_thread = _PyThreadState_INIT, \
4346
}
4447

Modules/gcmodule.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,6 @@ get_gc_state(void)
139139
void
140140
_PyGC_InitState(GCState *gcstate)
141141
{
142-
gcstate->enabled = 1; /* automatic collection enabled? */
143-
144142
#define _GEN_HEAD(n) GEN_HEAD(gcstate, n)
145143
struct gc_generation generations[NUM_GENERATIONS] = {
146144
/* PyGC_Head, threshold, count */

0 commit comments

Comments
 (0)