mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
add environment option to reserve huge pages upfront
This commit is contained in:
parent
741f37e1f0
commit
0e639addb0
4 changed files with 10 additions and 1 deletions
|
@ -422,6 +422,12 @@ static void mi_process_load(void) {
|
|||
const char* msg = NULL;
|
||||
mi_allocator_init(&msg);
|
||||
if (msg != NULL) _mi_verbose_message(msg);
|
||||
|
||||
if (mi_option_is_enabled(mi_option_reserve_huge_os_pages)) {
|
||||
size_t pages = mi_option_get(mi_option_reserve_huge_os_pages);
|
||||
double max_secs = (double)pages / 10.0; // 0.1s per page
|
||||
mi_reserve_huge_os_pages(pages, max_secs);
|
||||
}
|
||||
}
|
||||
|
||||
// Initialize the process; called by thread_init or the process loader
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue