mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-08-26 01:04:48 +03:00
add initial support for _mi_prim_reuse and MADV_FREE_REUSABLE on macOS (issue #1097)
This commit is contained in:
parent
2d34956bed
commit
d389819cc9
8 changed files with 64 additions and 7 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue