fix commit zero on windows

This commit is contained in:
daan 2019-09-02 14:53:22 -07:00
parent d1bd1644d5
commit 739d11313c
3 changed files with 14 additions and 7 deletions

View file

@ -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());
}