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

Function _mi_page_malloc

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

Fast allocation in a page: just pop from the free list. Fall back to generic allocation only if the list is empty.

Source from the content-addressed store, hash-verified

27// Fast allocation in a page: just pop from the free list.
28// Fall back to generic allocation only if the list is empty.
29extern inline void* _mi_page_malloc(mi_heap_t* heap, mi_page_t* page, size_t size, bool zero) mi_attr_noexcept {
30 mi_assert_internal(page->xblock_size==0||mi_page_block_size(page) >= size);
31 mi_block_t* const block = page->free;
32 if mi_unlikely(block == NULL) {
33 return _mi_malloc_generic(heap, size, zero, 0);
34 }
35 mi_assert_internal(block != NULL && _mi_ptr_page(block) == page);
36 // pop from the free list
37 page->used++;

Callers 3

page.cFile · 0.85

Calls 3

mi_page_block_sizeFunction · 0.85
mi_unlikelyFunction · 0.85
_mi_malloc_genericFunction · 0.85

Tested by

no test coverage detected