add is_zero flag to prim_commit

This commit is contained in:
daanx 2023-04-21 10:37:22 -07:00
parent 3bc577004a
commit 012f716485
5 changed files with 29 additions and 9 deletions

View file

@ -346,8 +346,9 @@ static void unix_mprotect_hint(int err) {
int _mi_prim_commit(void* start, size_t size) {
int _mi_prim_commit(void* start, size_t size, bool* is_zero) {
// commit: ensure we can access the area
*is_zero = false;
int err = mprotect(start, size, (PROT_READ | PROT_WRITE));
if (err != 0) { err = errno; }
unix_mprotect_hint(err);