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

Function _mi_usable_size

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

Source from the content-addressed store, hash-verified

601}
602
603static inline size_t _mi_usable_size(const void* p, const char* msg) mi_attr_noexcept {
604 if (p == NULL) return 0;
605 const mi_segment_t* const segment = mi_checked_ptr_segment(p, msg);
606 const mi_page_t* const page = _mi_segment_page_of(segment, p);
607 if mi_likely(!mi_page_has_aligned(page)) {
608 const mi_block_t* block = (const mi_block_t*)p;
609 return mi_page_usable_size_of(page, block);
610 }
611 else {
612 // split out to separate routine for improved code generation
613 return mi_page_usable_aligned_size_of(segment, page, p);

Callers 4

mi_usable_sizeFunction · 0.85
mi_free_sizeFunction · 0.85
mi_expandFunction · 0.85
_mi_heap_realloc_zeroFunction · 0.85

Calls 4

mi_checked_ptr_segmentFunction · 0.85
_mi_segment_page_ofFunction · 0.85
mi_page_has_alignedFunction · 0.85
mi_page_usable_size_ofFunction · 0.85

Tested by

no test coverage detected