mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-07 03:48:42 +03:00
fix TSAN warning for statistics maximum, issue #130
This commit is contained in:
parent
444afa934f
commit
8aa18d3661
2 changed files with 33 additions and 14 deletions
|
@ -27,7 +27,7 @@ static void mi_stat_update(mi_stat_count_t* stat, int64_t amount) {
|
|||
{
|
||||
// add atomically (for abandoned pages)
|
||||
mi_atomic_addi64(&stat->current,amount);
|
||||
mi_atomic_maxi64(&stat->peak, stat->current);
|
||||
mi_atomic_maxi64(&stat->peak, mi_atomic_readi64(&stat->current));
|
||||
if (amount > 0) {
|
||||
mi_atomic_addi64(&stat->allocated,amount);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue