Feat: add memalloc command

This commit is contained in:
2025-03-18 10:11:37 +08:00
parent c0e474fa32
commit ed2ced5caf
3 changed files with 19 additions and 8 deletions

View File

@@ -16,8 +16,7 @@ void *simple_alloc(size_t size)
_heap_top = (void *)&__heap_start;
}
if (size & 0xff)
size = (size & ~0xff) + 0x100;
size = (size_t)ALIGN8(size);
if ((uint64_t)_heap_top + size >= (uint64_t)&__heap_end)
exit(ERR_NO_MEM);