>> + max_size = (be->max < max_size) ? be->max : max_size; > min() / max() ? Good catch, this can be simplified. Not sure I like max_size = min (be->max, max_size), it's confusing. Maybe if (be->max < max_size) max_size = be->max;