Skip to content

Commit 71e8db7

Browse files
authored
Fix memory size calculation in tupleobject.c
Adjusted memory calculation for PyTupleObject freelist entries.
1 parent 8dfae59 commit 71e8db7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Objects/tupleobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,7 @@ _PyTuple_DebugMallocStats(FILE *out)
12741274
PyOS_snprintf(buf, sizeof(buf),
12751275
"free %d-sized PyTupleObject", len);
12761276
_PyDebugAllocatorStats(out, buf, _Py_FREELIST_SIZE(tuples[i]),
1277-
_PyObject_VAR_SIZE(&PyTuple_Type, len));
1277+
/* If you would like, you could remove the _PyType_PreHeaderSize(&PyTuple_Type) + to make it so that the freelist entries actual memory is calculated */
1278+
_PyType_PreHeaderSize(&PyTuple_Type) + _PyObject_VAR_SIZE(&PyTuple_Type, len));
12781279
}
12791280
}

0 commit comments

Comments
 (0)