Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 68055ce

Browse files
committed
When tracing references, reset the type and size of tuples allocated
from the fast free list -- the type (at least) is reset by _Py_Dealloc().
1 parent 21ef088 commit 68055ce

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Objects/tupleobject.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ PyTuple_New(size)
7373
free_tuples[size] = (PyTupleObject *) op->ob_item[0];
7474
#ifdef COUNT_ALLOCS
7575
fast_tuple_allocs++;
76+
#endif
77+
#ifdef Py_TRACE_REFS
78+
op->ob_type = &PyTuple_Type;
79+
op->ob_size = size;
7680
#endif
7781
}
7882
else

0 commit comments

Comments
 (0)