Skip to content

Commit a80dc28

Browse files
committed
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.
1 parent 0d93d3f commit a80dc28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libarena/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,7 @@ impl DroplessArena {
386386
self.align(align);
387387

388388
let future_end = intrinsics::arith_offset(self.ptr.get(), bytes as isize);
389-
if (future_end as *mut u8) >= self.end.get() {
389+
if (future_end as *mut u8) > self.end.get() {
390390
self.grow(bytes);
391391
}
392392

0 commit comments

Comments
 (0)