MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / _mi_os_free_huge_pages

Function _mi_os_free_huge_pages

3rd/mimalloc-2.0.9/src/os.c:1331–1339  ·  view source on GitHub ↗

free every huge page in a range individually (as we allocated per page) note: needed with VirtualAlloc but could potentially be done in one go on mmap'd systems.

Source from the content-addressed store, hash-verified

1329// free every huge page in a range individually (as we allocated per page)
1330// note: needed with VirtualAlloc but could potentially be done in one go on mmap'd systems.
1331void _mi_os_free_huge_pages(void* p, size_t size, mi_stats_t* stats) {
1332 if (p==NULL || size==0) return;
1333 uint8_t* base = (uint8_t*)p;
1334 while (size >= MI_HUGE_OS_PAGE_SIZE) {
1335 _mi_os_free(base, MI_HUGE_OS_PAGE_SIZE, stats);
1336 size -= MI_HUGE_OS_PAGE_SIZE;
1337 base += MI_HUGE_OS_PAGE_SIZE;
1338 }
1339}
1340
1341/* ----------------------------------------------------------------------------
1342Support NUMA aware allocation

Callers 1

Calls 1

_mi_os_freeFunction · 0.85

Tested by

no test coverage detected