https://github.com/python/cpython/commit/4e0677ac610d9e890503fc0c0ca8351bfdd5f000
commit: 4e0677ac610d9e890503fc0c0ca8351bfdd5f000
branch: main
author: Donghee Na <[email protected]>
committer: corona10 <[email protected]>
date: 2026-11-02T10:18:34+09:00
summary:

gh-113141: Tune MI_SEGMENT_SLICE_SHIFT to 14 for using 16 Kib pages (gh-160360)

files:
M Include/internal/pycore_mimalloc.h

diff --git a/Include/internal/pycore_mimalloc.h 
b/Include/internal/pycore_mimalloc.h
index dea88adac15db2d..b38feda494207b5 100644
--- a/Include/internal/pycore_mimalloc.h
+++ b/Include/internal/pycore_mimalloc.h
@@ -32,6 +32,11 @@ typedef enum {
 #  define MI_NO_THP 1
 // Do not use guarded allocations. The free-threaded GC does not support their 
block layout.
 #  define MI_GUARDED 0
+// Use 16 KiB pages instead of the default 64 KiB in 64-bit platforms.
+// TODO: 32-bit platforms may need tuning too.
+#  if SIZEOF_VOID_P == 8
+#    define MI_SEGMENT_SLICE_SHIFT 14
+#  endif
 #ifdef Py_DEBUG
 #  define MI_DEBUG 2
 #else

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to