Skip to content

Commit 5acff77

Browse files
Copilotequation314
andcommitted
Address code review feedback: improve variable naming clarity
Co-authored-by: equation314 <11389231+equation314@users.noreply.github.com>
1 parent aef48ef commit 5acff77

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/bitmap.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ impl<const PAGE_SIZE: usize> BaseAllocator for BitmapPageAllocator<PAGE_SIZE> {
6969
// But if this creates a gap that would exceed bitmap capacity,
7070
// use the start address itself as base.
7171
let aligned_base = crate::align_down(start, MAX_ALIGN_1GB);
72-
let start_idx = (start - aligned_base) / PAGE_SIZE;
72+
let gap_pages = (start - aligned_base) / PAGE_SIZE;
7373

74-
if start_idx + self.total_pages <= BitAllocUsed::CAP {
74+
if gap_pages + self.total_pages <= BitAllocUsed::CAP {
7575
// Use MAX_ALIGN_1GB aligned base for maximum alignment support
7676
self.base = aligned_base;
77-
self.inner.insert(start_idx..start_idx + self.total_pages);
77+
self.inner.insert(gap_pages..gap_pages + self.total_pages);
7878
} else {
7979
// Fall back to using start as base to fit within capacity
8080
// This may limit maximum alignment support, but prevents assertion failure

0 commit comments

Comments
 (0)