MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / _mi_prim_commit

Function _mi_prim_commit

system/lib/mimalloc/src/prim/unix/prim.c:472–485  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

470
471
472int _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
487int _mi_prim_reuse(void* start, size_t size) {
488 MI_UNUSED(start); MI_UNUSED(size);

Callers 1

_mi_os_commit_exFunction · 0.50

Calls 1

unix_mprotect_hintFunction · 0.85

Tested by

no test coverage detected