gh-144319: Use transparent huge pages via madvise(MADV_HUGEPAGE) in pymalloc (#144353)

This commit is contained in:
Maurycy Pawłowski-Wieroński
2026-04-30 23:18:07 +02:00
committed by GitHub
parent c80e446e6b
commit 5110738779
+3
View File
@@ -665,6 +665,9 @@ _PyMem_ArenaAlloc(void *Py_UNUSED(ctx), size_t size)
if (ptr == MAP_FAILED)
return NULL;
assert(ptr != NULL);
#ifdef MADV_HUGEPAGE
(void)madvise(ptr, size, MADV_HUGEPAGE);
#endif
(void)_PyAnnotateMemoryMap(ptr, size, "cpython:pymalloc");
return ptr;
#else