Use the proper code path to remove regions

... in fellow_busy_obj_trimstore():

The code did not work correctly when the region was to be removed
(because it was reduced to size zero) _and_ it was not the last of the
regions.

Part of the fix for #39
parent 04b32c0b
......@@ -4346,11 +4346,14 @@ fellow_busy_obj_trimstore(struct fellow_busy *fbo)
// fbr offset where fcs starts
base = fbr->len - fcs->alloc.size;
nsz = base + fcs->len;
fellow_region_trim(fc->ffd, fdr, nsz);
nsz = fdr->size;
if (nsz == 0)
fbo->nregion--;
fellow_busy_region_free(fbo, fdr);
else {
fellow_region_trim(fc->ffd, fdr, nsz);
nsz = fdr->size;
AN(nsz);
}
assert(fcs->alloc.size >= (nsz - base));
surplus = fcs->alloc.size - (nsz - base);
......
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