mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-06 23:39:31 +03:00
update stat adjustment for purging
This commit is contained in:
parent
58b726be6f
commit
264d5a6704
1 changed files with 1 additions and 3 deletions
|
@ -1427,13 +1427,11 @@ static bool mi_arena_purge(mi_arena_t* arena, size_t slice_index, size_t slice_c
|
|||
size_t already_committed;
|
||||
mi_bitmap_setN(arena->slices_committed, slice_index, slice_count, &already_committed);
|
||||
const bool all_committed = (already_committed == slice_count);
|
||||
if (mi_option_is_enabled(mi_option_purge_decommits)) {
|
||||
_mi_stat_adjust_increase(&_mi_stats_main.committed, mi_size_of_slices(already_committed), false /* on freed */);
|
||||
}
|
||||
const bool needs_recommit = _mi_os_purge_ex(p, size, all_committed /* allow reset? */);
|
||||
|
||||
// update committed bitmap
|
||||
if (needs_recommit) {
|
||||
_mi_stat_adjust_decrease(&_mi_stats_main.committed, mi_size_of_slices(slice_count - already_committed), false /* on freed */);
|
||||
mi_bitmap_clearN(arena->slices_committed, slice_index, slice_count);
|
||||
}
|
||||
return needs_recommit;
|
||||
|
|
Loading…
Add table
Reference in a new issue