File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -86,11 +86,11 @@ void _mi_stat_adjust_decrease(mi_stat_count_t* stat, size_t amount) {
8686static void mi_stat_count_add_mt (mi_stat_count_t * stat , const mi_stat_count_t * src ) {
8787 if (stat == src ) return ;
8888 mi_atomic_void_addi64_relaxed (& stat -> total , & src -> total );
89- mi_atomic_void_addi64_relaxed ( & stat -> current , & src -> current );
90- // peak scores do really not work across threads .. we just add them
91- mi_atomic_void_addi64_relaxed ( & stat -> peak , & src -> peak );
92- // or, take the max?
93- // mi_atomic_maxi64_relaxed(&stat->peak, src->peak);
89+
90+ int64_t prev_current = mi_atomic_addi64_relaxed ( & stat -> current , src -> current );
91+
92+ // global current plus thread peak approximates new global peak
93+ mi_atomic_maxi64_relaxed (& stat -> peak , prev_current + src -> peak );
9494}
9595
9696static void mi_stat_counter_add_mt (mi_stat_counter_t * stat , const mi_stat_counter_t * src ) {
You can’t perform that action at this time.
0 commit comments