Adjust a block that was allocated aligned, to the actual start of the block in the page.
| 472 | |
| 473 | // Adjust a block that was allocated aligned, to the actual start of the block in the page. |
| 474 | mi_block_t* _mi_page_ptr_unalign(const mi_segment_t* segment, const mi_page_t* page, const void* p) { |
| 475 | mi_assert_internal(page!=NULL && p!=NULL); |
| 476 | const size_t diff = (uint8_t*)p - _mi_page_start(segment, page, NULL); |
| 477 | const size_t adjust = (diff % mi_page_block_size(page)); |
| 478 | return (mi_block_t*)((uintptr_t)p - adjust); |
| 479 | } |
| 480 | |
| 481 | |
| 482 | void mi_decl_noinline _mi_free_generic(const mi_segment_t* segment, mi_page_t* page, bool is_local, void* p) mi_attr_noexcept { |
no test coverage detected