unsigned total, running, sleeping, stopped, zombie;
HIST_t *hist_tmp;
- if (!hist_sav) { // 1st time through
- hist_siz = 100;
- hist_sav = alloc_c(sizeof(HIST_t)*hist_siz);
- hist_new = alloc_c(sizeof(HIST_t)*hist_siz);
- }
-
// reuse memory each time around
hist_tmp = hist_sav;
hist_sav = hist_new;
break;
}
if (total+1 >= hist_siz) {
- hist_siz = hist_siz * 5 / 4 + 1; // grow by at least 25%
+ hist_siz = hist_siz * 5 / 4 + 100; // grow by at least 25%
hist_sav = alloc_r(hist_sav, sizeof(HIST_t)*hist_siz);
hist_new = alloc_r(hist_new, sizeof(HIST_t)*hist_siz);
}