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

Function mi_block_next

3rd/mimalloc-2.0.9/include/mimalloc-internal.h:723–737  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

721}
722
723static inline mi_block_t* mi_block_next(const mi_page_t* page, const mi_block_t* block) {
724 #ifdef MI_ENCODE_FREELIST
725 mi_block_t* next = mi_block_nextx(page,block,page->keys);
726 // check for free list corruption: is `next` at least in the same page?
727 // TODO: check if `next` is `page->block_size` aligned?
728 if mi_unlikely(next!=NULL && !mi_is_in_same_page(block, next)) {
729 _mi_error_message(EFAULT, "corrupted free list entry of size %zub at %p: value 0x%zx\n", mi_page_block_size(page), block, (uintptr_t)next);
730 next = NULL;
731 }
732 return next;
733 #else
734 MI_UNUSED(page);
735 return mi_block_nextx(page,block,NULL);
736 #endif
737}
738
739static inline void mi_block_set_next(const mi_page_t* page, mi_block_t* block, const mi_block_t* next) {
740 #ifdef MI_ENCODE_FREELIST

Callers 8

alloc.cFile · 0.85
mi_list_containsFunction · 0.85
mi_page_list_countFunction · 0.85
mi_page_list_is_validFunction · 0.85
mi_page_is_valid_initFunction · 0.85
ifFunction · 0.85

Calls 5

mi_block_nextxFunction · 0.85
mi_unlikelyFunction · 0.85
mi_is_in_same_pageFunction · 0.85
_mi_error_messageFunction · 0.85
mi_page_block_sizeFunction · 0.85

Tested by

no test coverage detected