From 05f2403dc2374ac7b5f13fb2cb9a7de38742fb9e Mon Sep 17 00:00:00 2001 From: Drew Galbraith Date: Thu, 11 Jan 2024 22:09:24 -0800 Subject: [PATCH] [Mammoth] Allow allocating slightly more memory. --- lib/mammoth/util/new.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/mammoth/util/new.cpp b/lib/mammoth/util/new.cpp index 9e9c2a5..3357d1e 100644 --- a/lib/mammoth/util/new.cpp +++ b/lib/mammoth/util/new.cpp @@ -12,7 +12,7 @@ class PageAllocator { public: static uint64_t AllocatePagePair() { uint64_t mem_cap; - check(ZMemoryObjectCreate(0x2000, &mem_cap)); + check(ZMemoryObjectCreate(0x4000, &mem_cap)); uint64_t vaddr; check(ZAddressSpaceMap(gSelfVmasCap, 0, mem_cap, /* align= */ 0x2000, @@ -60,8 +60,8 @@ class BuddyAllocator { void* Allocate(uint64_t size) { check(ZMutexLock(mutex_cap_)); - if (size > (0x2000 - sizeof(BuddySlot))) { - crash("Can't allocate greater than one page", glcr::UNIMPLEMENTED); + if (size > (0x4000 - sizeof(BuddySlot))) { + crash("Can't allocate greater than four pages", glcr::UNIMPLEMENTED); } if (free_front_ == nullptr) { AddPage();