improved accounting of committed bytes (issue #1035)

This commit is contained in:
Daan 2025-03-19 18:50:53 -07:00
parent 9a35bca556
commit 26fa8be427
6 changed files with 119 additions and 26 deletions

View file

@ -30,6 +30,7 @@ static void mi_stat_update(mi_stat_count_t* stat, int64_t amount) {
{
// add atomically (for abandoned pages)
int64_t current = mi_atomic_addi64_relaxed(&stat->current, amount);
// if (stat == &_mi_stats_main.committed) { mi_assert_internal(current + amount >= 0); };
mi_atomic_maxi64_relaxed(&stat->peak, current + amount);
if (amount > 0) {
mi_atomic_addi64_relaxed(&stat->total,amount);