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

Function _mi_os_alloc

system/lib/mimalloc/src/os.c:410–423  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

408----------------------------------------------------------- */
409
410void* _mi_os_alloc(size_t size, mi_memid_t* memid) {
411 *memid = _mi_memid_none();
412 if (size == 0) return NULL;
413 size = _mi_os_good_alloc_size(size);
414 bool os_is_large = false;
415 bool os_is_zero = false;
416 void* p = mi_os_prim_alloc(size, 0, true, false, &os_is_large, &os_is_zero);
417 if (p == NULL) return NULL;
418
419 *memid = _mi_memid_create_os(p, size, true, os_is_zero, os_is_large);
420 mi_assert_internal(memid->mem.os.size >= size);
421 mi_assert_internal(memid->initially_committed);
422 return p;
423}
424
425void* _mi_os_alloc_aligned(size_t size, size_t alignment, bool commit, bool allow_large, mi_memid_t* memid)
426{

Callers 2

_mi_os_zallocFunction · 0.85
_mi_meta_zallocFunction · 0.85

Calls 4

_mi_memid_noneFunction · 0.85
_mi_os_good_alloc_sizeFunction · 0.85
mi_os_prim_allocFunction · 0.85
_mi_memid_create_osFunction · 0.85

Tested by

no test coverage detected