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

Function mi_page_usable_size_of

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

Return the exact usable size of a block.

Source from the content-addressed store, hash-verified

242
243// Return the exact usable size of a block.
244static size_t mi_page_usable_size_of(const mi_page_t* page, const mi_block_t* block) {
245 size_t bsize;
246 size_t delta;
247 bool ok = mi_page_decode_padding(page, block, &delta, &bsize);
248 mi_assert_internal(ok); mi_assert_internal(delta <= bsize);
249 return (ok ? bsize - delta : 0);
250}
251
252static bool mi_verify_padding(const mi_page_t* page, const mi_block_t* block, size_t* size, size_t* wrong) {
253 size_t bsize;

Callers 3

mi_stat_freeFunction · 0.85
_mi_usable_sizeFunction · 0.85

Calls 2

mi_page_decode_paddingFunction · 0.85

Tested by

no test coverage detected