mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-08 00:09:31 +03:00
fix initialization of decommit mask for huge pages
This commit is contained in:
parent
b0e4309210
commit
1cbc55f2b8
1 changed files with 5 additions and 0 deletions
|
@ -509,6 +509,7 @@ static bool mi_segment_ensure_committed(mi_segment_t* segment, uint8_t* p, size_
|
||||||
mi_assert_internal(mi_commit_mask_all_set(&segment->commit_mask, &segment->decommit_mask));
|
mi_assert_internal(mi_commit_mask_all_set(&segment->commit_mask, &segment->decommit_mask));
|
||||||
// note: assumes commit_mask is always full for huge segments as otherwise the commit mask bits can overflow
|
// note: assumes commit_mask is always full for huge segments as otherwise the commit mask bits can overflow
|
||||||
if (mi_commit_mask_is_full(&segment->commit_mask) && mi_commit_mask_is_empty(&segment->decommit_mask)) return true; // fully committed
|
if (mi_commit_mask_is_full(&segment->commit_mask) && mi_commit_mask_is_empty(&segment->decommit_mask)) return true; // fully committed
|
||||||
|
mi_assert_internal(segment->kind != MI_SEGMENT_HUGE);
|
||||||
return mi_segment_commitx(segment,true,p,size,stats);
|
return mi_segment_commitx(segment,true,p,size,stats);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -904,6 +905,10 @@ static mi_segment_t* mi_segment_alloc(size_t required, size_t page_alignment, mi
|
||||||
mi_assert_internal(!mi_commit_mask_any_set(&segment->decommit_mask, &commit_needed_mask));
|
mi_assert_internal(!mi_commit_mask_any_set(&segment->decommit_mask, &commit_needed_mask));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
segment->decommit_expire = 0;
|
||||||
|
mi_commit_mask_create_empty( &segment->decommit_mask );
|
||||||
|
}
|
||||||
|
|
||||||
// initialize segment info
|
// initialize segment info
|
||||||
const size_t slice_entries = (segment_slices > MI_SLICES_PER_SEGMENT ? MI_SLICES_PER_SEGMENT : segment_slices);
|
const size_t slice_entries = (segment_slices > MI_SLICES_PER_SEGMENT ? MI_SLICES_PER_SEGMENT : segment_slices);
|
||||||
|
|
Loading…
Add table
Reference in a new issue