mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-08 04:18:42 +03:00
fix assertion
This commit is contained in:
parent
b4ca31bcd0
commit
9aec70ee02
2 changed files with 5 additions and 5 deletions
|
@ -302,8 +302,8 @@ static void _mi_show_block_trace(const mi_page_t* page, const mi_block_t* block,
|
|||
|
||||
static const mi_block_t* mi_block_predecessor(const mi_page_t* page, const mi_block_t* block) {
|
||||
const size_t bsize = page->xblock_size;
|
||||
mi_assert_internal(bsize > 0);
|
||||
if (bsize >= MI_HUGE_BLOCK_SIZE) return NULL;
|
||||
mi_assert_internal(bsize > 0 || page->used == 0);
|
||||
if (bsize == 0 /* if page is freed */|| bsize >= MI_HUGE_BLOCK_SIZE) return NULL;
|
||||
const mi_block_t* prev = (const mi_block_t*)((uint8_t*)block - bsize);
|
||||
uint8_t* pstart = _mi_segment_page_start(_mi_page_segment(page), page, NULL);
|
||||
if (pstart > (uint8_t*)prev) return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue