Skip to content

Commit 3df0c4d

Browse files
tim-onejohnslavik
andauthored
Note out-of-date obmalloc comments (#148149)
Vladimir's original overviews, from 1998, are still good, but going on 30 years later details have changed. Note that, but rather try to keep up with moving targets in a different file, point to sys._debugmallocstats() as the sure way to discover precise current details. No code changes, just added a block comment. Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
1 parent 8a73478 commit 3df0c4d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Include/internal/pycore_obmalloc.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ typedef unsigned int pymem_uint; /* assuming >= 16 bits */
1414
#undef uint
1515
#define uint pymem_uint
1616

17+
/* NOTE: the following overviews were in the initial checkin, in 1998. In
18+
* 2026, they're still helpful, but some details have changed. For example,
19+
* we now use 32 size classes 16 bytes apart, and an arena is generally at
20+
* least 1MB. Use sys._debugmallocstats() to see exact current details for
21+
* the specific version of CPython used.
22+
*/
1723

1824
/* An object allocator for Python.
1925

0 commit comments

Comments
 (0)