Change heap.first().has_value() to the cheaper heap.count()
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
73c58bd902
commit
7e62ee66be
@ -175,7 +175,7 @@ Result<void*> kmalloc(usize size, bool should_scrub)
|
||||
|
||||
size = align_up<16>(size);
|
||||
|
||||
if (!heap.first().has_value())
|
||||
if (heap.count() == 0)
|
||||
{
|
||||
const usize pages = get_pages_for_allocation(size + sizeof(HeapBlock));
|
||||
HeapBlock* const block = TRY(allocate_pages(pages));
|
||||
|
Loading…
Reference in New Issue
Block a user