We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 92d0080 commit 0c4b4e9Copy full SHA for 0c4b4e9
src/alloc/isolated_alloc.rs
@@ -44,8 +44,8 @@ impl IsolatedAlloc {
44
fn add_page(&mut self, page_size: usize) -> (*mut u8, &mut DenseBitSet<usize>) {
45
let page_layout = unsafe { Layout::from_size_align_unchecked(page_size, page_size) };
46
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)
+ // `page_infos` has to have one bit for each `COMPRESSION_FACTOR`-sized chunk of bytes in the page.
+ assert!(page_size % COMPRESSION_FACTOR == 0);
49
self.page_infos.push(DenseBitSet::new_empty(page_size / COMPRESSION_FACTOR));
50
self.page_ptrs.push(page_ptr);
51
(page_ptr, self.page_infos.last_mut().unwrap())
0 commit comments