Skip to content

Commit 5ace308

Browse files
nia-eRalfJung
andcommitted
Update src/alloc/isolated_alloc.rs
Co-authored-by: Ralf Jung <post@ralfj.de>
1 parent 9b71545 commit 5ace308

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/alloc/isolated_alloc.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,9 @@ impl IsolatedAlloc {
229229
pinfo.remove(idx);
230230
}
231231

232-
// Only 1 page might have been freed after a dealloc, so if it exists,
233-
// find it and free it (and adjust the vectors)
232+
// This may have been the last allocation on this page. If so, free the entire page.
233+
// FIXME: this can lead to threshold effects, we should probably add some form
234+
// of hysteresis.
234235
if pinfo.is_empty() {
235236
// SAFETY: `self.page_size` is always a power of 2 and does not overflow an isize
236237
let page_layout =

0 commit comments

Comments
 (0)