From 116b29b3516e7ae8d6b0df55d7e626fd09107e2f Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Sun, 5 Apr 2026 18:55:50 -0500 Subject: [PATCH 1/2] 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. --- 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 d4dbe541e6da51..7f4ba80214b573 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 clesses 16 bytes apart, and an arena is generally at + * last 1MB. Use sys._debugmallocstats() to see exact current details for + * the specific version of CPython is use. + */ /* An object allocator for Python. From e1274cd36250acc8323e1a1a519ab42b2709bdc5 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Sun, 5 Apr 2026 21:05:11 -0500 Subject: [PATCH 2/2] Update Include/internal/pycore_obmalloc.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit typo repairs. Co-authored-by: Bartosz Sławecki --- Include/internal/pycore_obmalloc.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Include/internal/pycore_obmalloc.h b/Include/internal/pycore_obmalloc.h index 7f4ba80214b573..f6b4bd90a23455 100644 --- a/Include/internal/pycore_obmalloc.h +++ b/Include/internal/pycore_obmalloc.h @@ -16,9 +16,9 @@ typedef unsigned int pymem_uint; /* assuming >= 16 bits */ /* 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 clesses 16 bytes apart, and an arena is generally at - * last 1MB. Use sys._debugmallocstats() to see exact current details for - * the specific version of CPython is use. + * 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.