Commit 86f6890e authored by Ben Gamari's avatar Ben Gamari 🐢

rts/M32Alloc: Abort if m32 linker mmap fails

Previously we should just blinding dereference a NULL pointer.
parent ea015172
......@@ -158,6 +158,9 @@ m32_allocator_init(void)
// fragment the memory.
size_t pgsz = getPageSize();
char* bigchunk = mmapForLinker(pgsz * M32_MAX_PAGES,MAP_ANONYMOUS,-1,0);
if (bigchunk == NULL)
barf("m32_allocator_init: Failed to map");
int i;
for (i=0; i<M32_MAX_PAGES; i++) {
alloc.pages[i].base_addr = bigchunk + i*pgsz;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment