MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / mi_heap_alloc_new_n

Function mi_heap_alloc_new_n

3rd/mimalloc-2.0.9/src/alloc.c:954–959  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

952
953
954mi_decl_nodiscard mi_decl_restrict extern inline void* mi_heap_alloc_new_n(mi_heap_t* heap, size_t count, size_t size) {
955 size_t total;
956 if mi_unlikely(mi_count_size_overflow(count, size, &total)) {
957 mi_try_new_handler(false); // on overflow we invoke the try_new_handler once to potentially throw std::bad_alloc
958 return NULL;
959 }
960 else {
961 return mi_heap_alloc_new(heap,total);
962 }

Callers 2

mi_new_nFunction · 0.85
allocateMethod · 0.85

Calls 3

mi_unlikelyFunction · 0.85
mi_count_size_overflowFunction · 0.85
mi_try_new_handlerFunction · 0.85

Tested by

no test coverage detected