mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-04 14:39:31 +03:00
fix atomic statistics counter increase
This commit is contained in:
parent
654bcd7049
commit
b3ce61c408
1 changed files with 3 additions and 4 deletions
|
@ -58,9 +58,8 @@ static void mi_stat_update(mi_stat_count_t* stat, int64_t amount) {
|
|||
}
|
||||
|
||||
void _mi_stat_counter_increase(mi_stat_counter_t* stat, size_t amount) {
|
||||
// TODO: add thread safe code
|
||||
stat->count++;
|
||||
stat->total += amount;
|
||||
mi_atomic_add( &stat->count, 1 );
|
||||
mi_atomic_add( &stat->total, (int64_t)amount );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue