[kernel] Fix frame allocator next-block bug
The frame allocator was causing page faults when exhausting the first (well, last, because it starts from the end) block of free pages. Turns out it was just incrementing instead of decrementing and thus running off the end.
This commit is contained in:
@@ -32,7 +32,7 @@ bsf(uint64_t v)
|
||||
size_t
|
||||
frame_allocator::allocate(size_t count, uintptr_t *address)
|
||||
{
|
||||
for (long i = m_count - 1; i >= 0; ++i) {
|
||||
for (long i = m_count - 1; i >= 0; --i) {
|
||||
frame_block &block = m_blocks[i];
|
||||
|
||||
if (!block.map1)
|
||||
|
||||
Reference in New Issue
Block a user