Allocate seglists for the worst case object size

Fixes one case for #22
parent 6445c85c
......@@ -2208,9 +2208,16 @@ fellow_body_seglist_alloc(struct fellow_busy *fbo,
assert(fbo->sz_estimate > fbo->sz_returned);
sz = fbo->sz_estimate - fbo->sz_returned;
sz >>= chunk_exponent;
assert(sz <= UINT16_MAX);
if (fbo->grown) {
sz = fbo->fc->tune->objsize_max - fbo->sz_dskalloc;
sz >>= MIN_FELLOW_BITS;
sz++;
} else {
sz = fbo->sz_estimate - fbo->sz_returned;
sz >>= chunk_exponent;
}
if (sz > UINT16_MAX)
sz = UINT16_MAX;
ldsegs = (uint16_t)sz;
ldsegs++;
......
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