mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-12 22:24:58 +03:00
fix commit zero on windows
This commit is contained in:
parent
d1bd1644d5
commit
739d11313c
3 changed files with 14 additions and 7 deletions
3
src/os.c
3
src/os.c
|
@ -601,8 +601,9 @@ static bool mi_os_commitx(void* addr, size_t size, bool commit, bool conservativ
|
|||
}
|
||||
|
||||
#if defined(_WIN32)
|
||||
*is_zero = true;
|
||||
if (commit) {
|
||||
// if the memory was already committed, the call succeeds but it is not zero'd
|
||||
// *is_zero = true;
|
||||
void* p = VirtualAlloc(start, csize, MEM_COMMIT, PAGE_READWRITE);
|
||||
err = (p == start ? 0 : GetLastError());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue