span->first_page = preceding_span->first_page;
span->npages += preceding_span->npages;
mspan_destroy_span(base, preceding_span);
+ /*
+ * XXX. This is a problem. Suppose we destroy the preceding span
+ * and it releases a superblock just preceding the current span.
+ * Now that span can't consolidate with this one nor visca versa.
+ */
}
}
if (mgr->npages == 0 || span->first_page + span->npages < mgr->boundary)
mspan_unlink_span(base, following_span);
span->npages += following_span->npages;
mspan_destroy_span(base, following_span);
+ /*
+ * XXX. Here again, destroying the following span could create
+ * another free chunk that needs to be consolidated with this span.
+ */
}
}