Allocate seglists for the worst case object size

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