mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
parent
a73c3cc7e2
commit
71b3e16171
4 changed files with 10 additions and 23 deletions
|
@ -566,14 +566,14 @@ static inline size_t _mi_page_map_index(const void* p, size_t* sub_idx) {
|
|||
static inline mi_page_t* _mi_unchecked_ptr_page(const void* p) {
|
||||
size_t sub_idx;
|
||||
const size_t idx = _mi_page_map_index(p, &sub_idx);
|
||||
return _mi_page_map[idx][sub_idx];
|
||||
return _mi_page_map[idx][sub_idx]; // NULL if p==NULL
|
||||
}
|
||||
|
||||
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) return NULL;
|
||||
return sub[sub_idx];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue