[zion] Fix an over-allocation bug when creating a memory object

This commit is contained in:
Drew Galbraith 2023-06-12 20:55:53 -07:00
parent 0f0e39d1e9
commit b6735d3175
3 changed files with 9 additions and 2 deletions

View file

@ -61,6 +61,9 @@ class PhysicalMemoryManager {
front_ = front_->next;
delete temp;
}
#if K_PHYS_DEBUG
dbgln("Single %m", page);
#endif
return page;
}
uint64_t AllocateContinuous(uint64_t num_pages) {
@ -89,6 +92,9 @@ class PhysicalMemoryManager {
front_ = front_->next;
delete temp;
}
#if K_PHYS_DEBUG
dbgln("Continuous %m:%u", page, num_pages);
#endif
return page;
}
void FreePage(uint64_t page) { AddMemoryRegion(page, 0x1000); }