[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

@ -24,7 +24,8 @@ KernelHeap::KernelHeap(uint64_t lower_bound, uint64_t upper_bound)
void* KernelHeap::Allocate(uint64_t size) {
if (next_addr_ + size >= upper_bound_) {
panic("Kernel Heap Overrun");
panic("Kernel Heap Overrun (next, size, max): %m, %x, %m", next_addr_, size,
upper_bound_);
}
#if K_HEAP_DEBUG
RecordSize(size);