mimalloc
mimalloc copied to clipboard
Minor nit: long vs int warning in mi_process_init()
Playing with pedantic warning compiler flags, came across a minor int vs long issue:
https://github.com/microsoft/mimalloc/blob/09a27098aa6e9286518bd9c74e6ffa7199c3f04e/src/init.c#L652
It's obtaining a long from the options:
long reserve_at = mi_option_get(mi_option_reserve_huge_os_pages_at);
But mi_reserve_huge_os_pages_at() wants an int for the second parameter. The naive fix seems to be:
int reserve_at = (int)mi_option_get_clamp(mi_option_reserve_huge_os_pages_at, -1, INT_MAX);