mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-03 14:09:31 +03:00
fix invalid page detection
This commit is contained in:
parent
7d4ee62386
commit
722c48df08
1 changed files with 2 additions and 1 deletions
|
@ -573,7 +573,8 @@ static inline mi_page_t* _mi_checked_ptr_page(const void* p) {
|
|||
size_t sub_idx;
|
||||
const size_t idx = _mi_page_map_index(p, &sub_idx);
|
||||
mi_page_t** const sub = _mi_page_map[idx];
|
||||
if mi_unlikely(sub == NULL) return (mi_page_t*)&_mi_page_empty;
|
||||
if mi_unlikely (sub == NULL || *sub == NULL)
|
||||
return (mi_page_t *)&_mi_page_empty;
|
||||
return sub[sub_idx];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue