Skip to content

Commit 8b7fcd5

Browse files
some clean
1 parent f1220e4 commit 8b7fcd5

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

Include/internal/pycore_gc.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ static inline void _PyObject_GC_TRACK(
240240

241241
PyInterpreterState *interp = _PyInterpreterState_GET();
242242
PyGC_Head *generation0 = &interp->gc.young.head;
243-
interp->gc.young.count++;
243+
interp->gc.young.count++; /* number of tracked GC objects */
244244
PyGC_Head *last = (PyGC_Head*)(generation0->_gc_prev);
245245
_PyGCHead_SET_NEXT(last, gc);
246246
_PyGCHead_SET_PREV(gc, last);
@@ -281,12 +281,11 @@ static inline void _PyObject_GC_UNTRACK(
281281
_PyGCHead_SET_PREV(next, prev);
282282
gc->_gc_next = 0;
283283
gc->_gc_prev &= _PyGC_PREV_MASK_FINALIZED;
284-
#endif
285-
286284
PyInterpreterState *interp = _PyInterpreterState_GET();
287285
if (interp->gc.young.count > 0) {
288286
interp->gc.young.count--;
289287
}
288+
#endif
290289
}
291290

292291

Python/gc.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2316,7 +2316,6 @@ _PyObject_GC_Link(PyObject *op)
23162316
GCState *gcstate = &tstate->interp->gc;
23172317
gc->_gc_next = 0;
23182318
gc->_gc_prev = 0;
2319-
//gcstate->young.count++; /* number of allocated GC objects */
23202319
gcstate->heap_size++;
23212320
if (gcstate->young.count > gcstate->young.threshold &&
23222321
gcstate->enabled &&
@@ -2448,9 +2447,6 @@ PyObject_GC_Del(void *op)
24482447
#endif
24492448
}
24502449
GCState *gcstate = get_gc_state();
2451-
//if (gcstate->young.count > 0) {
2452-
// gcstate->young.count--;
2453-
//}
24542450
gcstate->heap_size--;
24552451
PyObject_Free(((char *)op)-presize);
24562452
}

0 commit comments

Comments
 (0)