Fix off-by-one error in `DroplessArena::alloc_raw`.

This causes unnecessary calls to `grow` when the allocation would fit
exactly in the remaining space.
This commit is contained in:
Nicholas Nethercote 2020-05-21 10:36:32 +10:00
parent bc10b68e79
commit 5ceff6b96a
1 changed files with 1 additions and 1 deletions

View File

@ -386,7 +386,7 @@ impl DroplessArena {
self.align(align);
let future_end = intrinsics::arith_offset(self.ptr.get(), bytes as isize);
if (future_end as *mut u8) >= self.end.get() {
if (future_end as *mut u8) > self.end.get() {
self.grow(bytes);
}