Rename largest_free -> largest_free_entry
This commit is contained in:
parent
d9fc50f1ea
commit
bfd4647467
@ -53,9 +53,9 @@ namespace MemoryManager
|
|||||||
MemoryMapIterator iter;
|
MemoryMapIterator iter;
|
||||||
MemoryMapEntry entry;
|
MemoryMapEntry entry;
|
||||||
|
|
||||||
const auto largest_free = iter.largest_free();
|
const auto largest_free_entry = iter.largest_free();
|
||||||
|
|
||||||
expect(largest_free.is_free(), "We were given a largest free memory region that isn't even free!");
|
expect(largest_free_entry.is_free(), "We were given a largest free memory region that isn't even free!");
|
||||||
|
|
||||||
// The entire physical address space. May contain inexistent memory holes, thus differs from total_mem which
|
// The entire physical address space. May contain inexistent memory holes, thus differs from total_mem which
|
||||||
// only counts existent memory. Our bitmap needs to have space for all of the physical address space, since
|
// only counts existent memory. Our bitmap needs to have space for all of the physical address space, since
|
||||||
@ -63,13 +63,14 @@ namespace MemoryManager
|
|||||||
const usize physical_address_space_size = get_physical_address_space_size();
|
const usize physical_address_space_size = get_physical_address_space_size();
|
||||||
|
|
||||||
// We store our frame bitmap at the beginning of the largest free memory block.
|
// We store our frame bitmap at the beginning of the largest free memory block.
|
||||||
char* const frame_bitmap_addr = (char*)largest_free.ptr();
|
char* const frame_bitmap_addr = (char*)largest_free_entry.ptr();
|
||||||
|
|
||||||
const usize frame_bitmap_size = get_blocks_from_size(physical_address_space_size / ARCH_PAGE_SIZE, 8UL);
|
const usize frame_bitmap_size = get_blocks_from_size(physical_address_space_size / ARCH_PAGE_SIZE, 8UL);
|
||||||
|
|
||||||
// This should never happen, unless memory is very fragmented. Usually there is always a very big block of
|
// This should never happen, unless memory is very fragmented. Usually there is always a very big block of
|
||||||
// usable memory and then some tiny blocks around it.
|
// usable memory and then some tiny blocks around it.
|
||||||
expect(frame_bitmap_size < largest_free.size(), "No single memory region is enough to hold the frame bitmap");
|
expect(frame_bitmap_size < largest_free_entry.size(),
|
||||||
|
"No single memory region is enough to hold the frame bitmap");
|
||||||
|
|
||||||
g_frame_bitmap.initialize(frame_bitmap_addr, frame_bitmap_size);
|
g_frame_bitmap.initialize(frame_bitmap_addr, frame_bitmap_size);
|
||||||
|
|
||||||
@ -89,7 +90,7 @@ namespace MemoryManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Make sure that the physical frames used by the bitmap aren't handed out to anyone else.
|
// Make sure that the physical frames used by the bitmap aren't handed out to anyone else.
|
||||||
lock_frames(largest_free.address(), get_blocks_from_size(frame_bitmap_size, ARCH_PAGE_SIZE));
|
lock_frames(largest_free_entry.address(), get_blocks_from_size(frame_bitmap_size, ARCH_PAGE_SIZE));
|
||||||
}
|
}
|
||||||
|
|
||||||
void init()
|
void init()
|
||||||
|
Loading…
Reference in New Issue
Block a user