[Zion] Add more debug information about kernel heap usage.
This will be helpful as we work to improve it. Without deallocations, we currently stand at the following alloc numbers 8 - 142 16 - 319 32 - 364 unsized - 305 total page usage including slabs is 12.
This commit is contained in:
parent
4657c46f73
commit
6d27ee5dc5
6 changed files with 87 additions and 35 deletions
|
|
@ -93,3 +93,23 @@ glcr::ErrorOr<void*> SlabAllocator::Allocate() {
|
|||
slabs_.PushFront(glcr::AdoptPtr(new (next_slab) Slab(elem_size_)));
|
||||
return slabs_.PeekFront()->Allocate();
|
||||
}
|
||||
|
||||
uint64_t SlabAllocator::SlabCount() {
|
||||
auto slab = slabs_.PeekFront();
|
||||
uint64_t count = 0;
|
||||
while (slab) {
|
||||
count++;
|
||||
slab = slab->next_;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
uint64_t SlabAllocator::Allocations() {
|
||||
auto slab = slabs_.PeekFront();
|
||||
uint64_t count = 0;
|
||||
while (slab) {
|
||||
count += slab->Allocations();
|
||||
slab = slab->next_;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue