mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-08-25 16:54:47 +03:00
add padding check in usable size
This commit is contained in:
parent
a38abae0a1
commit
083392fa15
2 changed files with 9 additions and 8 deletions
|
@ -213,7 +213,8 @@ static bool mi_page_decode_padding(const mi_page_t* page, const mi_block_t* bloc
|
|||
static size_t mi_page_usable_size_of(const mi_page_t* page, const mi_block_t* block) {
|
||||
size_t bsize;
|
||||
size_t delta;
|
||||
bool ok = mi_page_decode_padding(page, block, &delta, &bsize);
|
||||
bool ok = mi_page_decode_padding(page, block, &delta, &bsize);
|
||||
if (!ok) { mi_check_padding(page, block); }
|
||||
mi_assert_internal(ok); mi_assert_internal(delta <= bsize);
|
||||
return (ok ? bsize - delta : 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue