mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 05:37:43 +00:00
Kernel: Put kmalloc heap expansion debug spam behind KMALLOC_DEBUG
This commit is contained in:
parent
04bec7a4f5
commit
1d411a46c1
1 changed files with 2 additions and 2 deletions
|
@ -184,7 +184,7 @@ struct KmallocGlobalData {
|
||||||
|
|
||||||
void add_subheap(u8* storage, size_t storage_size)
|
void add_subheap(u8* storage, size_t storage_size)
|
||||||
{
|
{
|
||||||
dbgln("Adding kmalloc subheap @ {} with size {}", storage, storage_size);
|
dbgln_if(KMALLOC_DEBUG, "Adding kmalloc subheap @ {} with size {}", storage, storage_size);
|
||||||
static_assert(sizeof(KmallocSubheap) <= PAGE_SIZE);
|
static_assert(sizeof(KmallocSubheap) <= PAGE_SIZE);
|
||||||
auto* subheap = new (storage) KmallocSubheap(storage + PAGE_SIZE, storage_size - PAGE_SIZE);
|
auto* subheap = new (storage) KmallocSubheap(storage + PAGE_SIZE, storage_size - PAGE_SIZE);
|
||||||
subheaps.append(*subheap);
|
subheaps.append(*subheap);
|
||||||
|
@ -269,7 +269,7 @@ struct KmallocGlobalData {
|
||||||
}
|
}
|
||||||
size_t new_subheap_size = max(minimum_subheap_size, rounded_allocation_request.value());
|
size_t new_subheap_size = max(minimum_subheap_size, rounded_allocation_request.value());
|
||||||
|
|
||||||
dbgln("Unable to allocate {}, expanding kmalloc heap", allocation_request);
|
dbgln_if(KMALLOC_DEBUG, "Unable to allocate {}, expanding kmalloc heap", allocation_request);
|
||||||
|
|
||||||
if (!expansion_data->virtual_range.contains(new_subheap_base, new_subheap_size)) {
|
if (!expansion_data->virtual_range.contains(new_subheap_base, new_subheap_size)) {
|
||||||
// FIXME: Dare to return false and allow kmalloc() to fail!
|
// FIXME: Dare to return false and allow kmalloc() to fail!
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue