Skip to content

Commit 0c4b4e9

Browse files
nia-eRalfJung
andauthored
Update src/alloc/isolated_alloc.rs
Co-authored-by: Ralf Jung <post@ralfj.de>
1 parent 92d0080 commit 0c4b4e9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/alloc/isolated_alloc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ impl IsolatedAlloc {
4444
fn add_page(&mut self, page_size: usize) -> (*mut u8, &mut DenseBitSet<usize>) {
4545
let page_layout = unsafe { Layout::from_size_align_unchecked(page_size, page_size) };
4646
let page_ptr = unsafe { alloc::alloc(page_layout) };
47-
// `page_infos` has to have one-eighth as many bits as a page has bytes
48-
// (or one-64th as many bytes)
47+
// `page_infos` has to have one bit for each `COMPRESSION_FACTOR`-sized chunk of bytes in the page.
48+
assert!(page_size % COMPRESSION_FACTOR == 0);
4949
self.page_infos.push(DenseBitSet::new_empty(page_size / COMPRESSION_FACTOR));
5050
self.page_ptrs.push(page_ptr);
5151
(page_ptr, self.page_infos.last_mut().unwrap())

0 commit comments

Comments
 (0)