mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-06 19:38:41 +03:00
first working version of new segment allocation
This commit is contained in:
parent
6ee248b012
commit
f2ba95bc64
3 changed files with 51 additions and 29 deletions
|
@ -254,7 +254,12 @@ static inline mi_slice_t* mi_page_to_slice(mi_page_t* p) {
|
|||
return (mi_slice_t*)(p);
|
||||
}
|
||||
|
||||
|
||||
static size_t mi_slice_index(const mi_slice_t* slice) {
|
||||
mi_segment_t* segment = _mi_ptr_segment(slice);
|
||||
ptrdiff_t index = slice - segment->slices;
|
||||
mi_assert_internal(index >= 0 && index < (ptrdiff_t)segment->slice_count);
|
||||
return index;
|
||||
}
|
||||
|
||||
// Segment belonging to a page
|
||||
static inline mi_segment_t* _mi_page_segment(const mi_page_t* page) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue