| 470 | |
| 471 | |
| 472 | int _mi_prim_commit(void* start, size_t size, bool* is_zero) { |
| 473 | // commit: ensure we can access the area |
| 474 | // note: we may think that *is_zero can be true since the memory |
| 475 | // was either from mmap PROT_NONE, or from decommit MADV_DONTNEED, but |
| 476 | // we sometimes call commit on a range with still partially committed |
| 477 | // memory and `mprotect` does not zero the range. |
| 478 | *is_zero = false; |
| 479 | int err = mprotect(start, size, (PROT_READ | PROT_WRITE)); |
| 480 | if (err != 0) { |
| 481 | err = errno; |
| 482 | unix_mprotect_hint(err); |
| 483 | } |
| 484 | return err; |
| 485 | } |
| 486 | |
| 487 | int _mi_prim_reuse(void* start, size_t size) { |
| 488 | MI_UNUSED(start); MI_UNUSED(size); |
no test coverage detected