Skip to content

Commit 5110738

Browse files
authored
gh-144319: Use transparent huge pages via madvise(MADV_HUGEPAGE) in pymalloc (#144353)
1 parent c80e446 commit 5110738

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

Objects/obmalloc.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,9 @@ _PyMem_ArenaAlloc(void *Py_UNUSED(ctx), size_t size)
665665
if (ptr == MAP_FAILED)
666666
return NULL;
667667
assert(ptr != NULL);
668+
#ifdef MADV_HUGEPAGE
669+
(void)madvise(ptr, size, MADV_HUGEPAGE);
670+
#endif
668671
(void)_PyAnnotateMemoryMap(ptr, size, "cpython:pymalloc");
669672
return ptr;
670673
#else

0 commit comments

Comments
 (0)