Skip to content

Commit

Permalink
Fixed stacked borrows violation in dealloc (fixes fitzgen#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluurryy committed May 19, 2024
1 parent 30f8491 commit 676afdc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1705,6 +1705,7 @@ impl Bump {
// If the pointer is the last allocation we made, we can reuse the bytes,
// otherwise they are simply leaked -- at least until somebody calls reset().
if self.is_last_allocation(ptr) {
let ptr = self.current_chunk_footer.get().as_ref().ptr.get();
let ptr = NonNull::new_unchecked(ptr.as_ptr().add(layout.size()));
self.current_chunk_footer.get().as_ref().ptr.set(ptr);
}
Expand Down

0 comments on commit 676afdc

Please sign in to comment.