Change heap.first().has_value() to the cheaper heap.count()
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2022-12-26 12:24:39 +01:00
parent 73c58bd902
commit 7e62ee66be
Signed by: apio
GPG Key ID: B8A7D06E42258954

View File

@ -175,7 +175,7 @@ Result<void*> kmalloc(usize size, bool should_scrub)
size = align_up<16>(size); size = align_up<16>(size);
if (!heap.first().has_value()) if (heap.count() == 0)
{ {
const usize pages = get_pages_for_allocation(size + sizeof(HeapBlock)); const usize pages = get_pages_for_allocation(size + sizeof(HeapBlock));
HeapBlock* const block = TRY(allocate_pages(pages)); HeapBlock* const block = TRY(allocate_pages(pages));