[Zion] Make kernel slab allocation failures less chatty.

We started to hit this constraint but the allocators are due for
a redesign that actually does deallocation soon.
This commit is contained in:
Drew Galbraith 2023-11-15 09:45:37 -08:00
parent 43f19d7a26
commit e5568450c2
1 changed files with 9 additions and 3 deletions

View File

@ -43,21 +43,27 @@ void* KernelHeap::Allocate(uint64_t size) {
if (ptr_or.ok()) {
return ptr_or.value();
}
dbgln("Failed allocation (slab 8): {x}", ptr_or.error());
#if K_HEAP_DEBUG
dbgln("Skipped allocation (slab 8): {x}", ptr_or.error());
#endif
}
if ((size <= 16) && slab_16_) {
auto ptr_or = slab_16_->Allocate();
if (ptr_or.ok()) {
return ptr_or.value();
}
dbgln("Failed allocation (slab 16): {x}", ptr_or.error());
#if K_HEAP_DEBUG
dbgln("Skipped allocation (slab 16): {x}", ptr_or.error());
#endif
}
if ((size <= 32) && slab_32_) {
auto ptr_or = slab_32_->Allocate();
if (ptr_or.ok()) {
return ptr_or.value();
}
dbgln("Failed allocation (slab 32): {x}", ptr_or.error());
#if K_HEAP_DEBUG
dbgln("Skipped allocation (slab 32): {x}", ptr_or.error());
#endif
}
if (next_addr_ + size >= upper_bound_) {
panic("Kernel Heap Overrun (next, size, max): {x}, {x}, {x}", next_addr_,