Skip to content

Commit 38c1212

Browse files
committed
Initialize now under if (gcstate->debug ...) cond
1 parent d6a6054 commit 38c1212

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Python/gc.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2067,8 +2067,11 @@ _PyGC_Collect(PyThreadState *tstate, int generation, _PyGC_Reason reason)
20672067
{
20682068
GCState *gcstate = &tstate->interp->gc;
20692069
assert(tstate->current_frame == NULL || tstate->current_frame->stackpointer != NULL);
2070+
20702071
PyTime_t now;
2071-
(void)PyTime_MonotonicRaw(&now);
2072+
if (gcstate->debug & _PyGC_DEBUG_STATS) {
2073+
(void)PyTime_MonotonicRaw(&now);
2074+
}
20722075

20732076
int expected = 0;
20742077
if (!_Py_atomic_compare_exchange_int(&gcstate->collecting, &expected, 1)) {

0 commit comments

Comments
 (0)