Branch: Tag:

2017-02-23

2017-02-23 13:45:43 by Martin Karlgren <marty@roxen.com>

Cache: Fix division by zero that could occur at startup due to race.

385:    int startup = tot_period < cm_stats_avg_period;    if (!startup) tot_period = (float) cm_stats_avg_period;    -  float our_weight = min (last_period / tot_period, 1.0); +  float our_weight = min (tot_period != 0.0 && last_period / tot_period, 1.0);    float old_weight = 1.0 - our_weight;       if (startup) {