From 3df0c4da4c502a4e26ed00468dd97aa50a3bb260 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Mon, 6 Apr 2026 23:08:47 -0500 Subject: [PATCH] Note out-of-date obmalloc comments (#148149) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- Include/internal/pycore_obmalloc.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Include/internal/pycore_obmalloc.h b/Include/internal/pycore_obmalloc.h index d4dbe541e6da..f6b4bd90a234 100644 --- a/Include/internal/pycore_obmalloc.h +++ b/Include/internal/pycore_obmalloc.h @@ -14,6 +14,12 @@ typedef unsigned int pymem_uint; /* assuming >= 16 bits */ #undef uint #define uint pymem_uint +/* NOTE: the following overviews were in the initial checkin, in 1998. In + * 2026, they're still helpful, but some details have changed. For example, + * we now use 32 size classes 16 bytes apart, and an arena is generally at + * least 1MB. Use sys._debugmallocstats() to see exact current details for + * the specific version of CPython used. + */ /* An object allocator for Python. -- 2.47.3