mirror of
https://github.com/python/cpython.git
synced 2026-05-06 04:37:33 -04:00
gh-144319: Use transparent huge pages via madvise(MADV_HUGEPAGE) in pymalloc (#144353)
This commit is contained in:
committed by
GitHub
parent
c80e446e6b
commit
5110738779
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user