| 721 | } |
| 722 | |
| 723 | static 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 | |
| 739 | static 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 |
no test coverage detected