Refactor size estimate

parent bef3d014
......@@ -3591,14 +3591,20 @@ fellow_busy_obj_getspace(struct fellow_busy *fbo, size_t *sz, uint8_t **ptr)
fbo->sz_estimate = *sz;
fbo->sz_increment = *sz;
} else if (*sz + fbo->sz_returned > fbo->sz_estimate) {
fbo->grown++;
delta = *sz + fbo->sz_returned - fbo->sz_estimate;
if (fbo->sz_increment < delta)
fbo->sz_increment = delta;
fbo->sz_estimate += fbo->sz_increment;
fbo->sz_increment <<= 1;
// XXX wip
fbo->grown = 1;
if (fbo->sz_estimate > fbo->fc->tune->objsize_max) {
fbo->sz_estimate = fbo->fc->tune->objsize_max;
fbo->sz_increment = 0;
} else if (fbo->sz_increment < delta) {
fbo->sz_estimate += delta;
fbo->sz_increment = delta;
} else {
fbo->sz_estimate += fbo->sz_increment;
fbo->sz_increment <<= 1;
}
}
fcs = fbo->body_seg;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment