Patch by @nilset.
@@ -643,6 +643,14 @@ pub trait Allocator: ops::DerefMut<Target = Bookkeeper> {
self.free(x);
}
+ // Try again to merge with last block on the off chance reserve pushed something we can
+ // merge with. This has actually happened in testing.
+ if let Some(x) = self.pool.last_mut() {
+ if x.merge_right(&mut block).is_ok() {
+ return;
+ }
+
// Merging failed. Note that trailing empty blocks are not allowed, hence the last block is
// the only non-empty candidate which may be adjacent to `block`.
@@ -23,6 +23,7 @@
single_match_else, string_add, string_add_assign, wrong_pub_self_convention)]
#[macro_use]
+#[no_link]
extern crate unborrow;
#[cfg(feature = "write")]