add initial support for _mi_prim_reuse and MADV_FREE_REUSABLE on macOS (issue #1097)

This commit is contained in:
Daan 2025-06-06 17:59:46 -07:00
parent 2d34956bed
commit d389819cc9
8 changed files with 64 additions and 7 deletions

View file

@ -352,6 +352,11 @@ int _mi_prim_reset(void* addr, size_t size) {
return (p != NULL ? 0 : (int)GetLastError());
}
int _mi_prim_reuse(void* addr, size_t size) {
MI_UNUSED(addr); MI_UNUSED(size);
return 0;
}
int _mi_prim_protect(void* addr, size_t size, bool protect) {
DWORD oldprotect = 0;
BOOL ok = VirtualProtect(addr, size, protect ? PAGE_NOACCESS : PAGE_READWRITE, &oldprotect);