[Mammoth] Allow allocating slightly more memory.
This commit is contained in:
parent
a48d63a664
commit
05f2403dc2
|
@ -12,7 +12,7 @@ class PageAllocator {
|
||||||
public:
|
public:
|
||||||
static uint64_t AllocatePagePair() {
|
static uint64_t AllocatePagePair() {
|
||||||
uint64_t mem_cap;
|
uint64_t mem_cap;
|
||||||
check(ZMemoryObjectCreate(0x2000, &mem_cap));
|
check(ZMemoryObjectCreate(0x4000, &mem_cap));
|
||||||
|
|
||||||
uint64_t vaddr;
|
uint64_t vaddr;
|
||||||
check(ZAddressSpaceMap(gSelfVmasCap, 0, mem_cap, /* align= */ 0x2000,
|
check(ZAddressSpaceMap(gSelfVmasCap, 0, mem_cap, /* align= */ 0x2000,
|
||||||
|
@ -60,8 +60,8 @@ class BuddyAllocator {
|
||||||
|
|
||||||
void* Allocate(uint64_t size) {
|
void* Allocate(uint64_t size) {
|
||||||
check(ZMutexLock(mutex_cap_));
|
check(ZMutexLock(mutex_cap_));
|
||||||
if (size > (0x2000 - sizeof(BuddySlot))) {
|
if (size > (0x4000 - sizeof(BuddySlot))) {
|
||||||
crash("Can't allocate greater than one page", glcr::UNIMPLEMENTED);
|
crash("Can't allocate greater than four pages", glcr::UNIMPLEMENTED);
|
||||||
}
|
}
|
||||||
if (free_front_ == nullptr) {
|
if (free_front_ == nullptr) {
|
||||||
AddPage();
|
AddPage();
|
||||||
|
|
Loading…
Reference in New Issue