Skip to content

Commit 5c3a5ef

Browse files
committed
Rename get_heap_size
1 parent ac3ad26 commit 5c3a5ef

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Lib/test/test_gc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1173,14 +1173,14 @@ def make_ll(depth):
11731173
enabled = gc.isenabled()
11741174
gc.enable()
11751175
olds = []
1176-
initial_heap_size = _testinternalcapi.get_heap_size()
1176+
initial_heap_size = _testinternalcapi.get_tracked_heap_size()
11771177
for i in range(20_000):
11781178
newhead = make_ll(20)
11791179
count += 20
11801180
newhead.surprise = head
11811181
olds.append(newhead)
11821182
if len(olds) == 20:
1183-
new_objects = _testinternalcapi.get_heap_size() - initial_heap_size
1183+
new_objects = _testinternalcapi.get_tracked_heap_size() - initial_heap_size
11841184
self.assertLess(new_objects, 25_000)
11851185
del olds[:]
11861186
if not enabled:

Modules/_testinternalcapi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,7 +2077,7 @@ has_deferred_refcount(PyObject *self, PyObject *op)
20772077
}
20782078

20792079
static PyObject *
2080-
get_heap_size(PyObject *self, PyObject *Py_UNUSED(ignored))
2080+
get_tracked_heap_size(PyObject *self, PyObject *Py_UNUSED(ignored))
20812081
{
20822082
return PyLong_FromInt64(PyInterpreterState_Get()->gc.heap_size);
20832083
}
@@ -2179,7 +2179,7 @@ static PyMethodDef module_functions[] = {
21792179
{"get_static_builtin_types", get_static_builtin_types, METH_NOARGS},
21802180
{"identify_type_slot_wrappers", identify_type_slot_wrappers, METH_NOARGS},
21812181
{"has_deferred_refcount", has_deferred_refcount, METH_O},
2182-
{"get_heap_size", get_heap_size, METH_NOARGS},
2182+
{"get_tracked_heap_size", get_tracked_heap_size, METH_NOARGS},
21832183
{NULL, NULL} /* sentinel */
21842184
};
21852185

0 commit comments

Comments
 (0)