Closed halvbanan closed 9 months ago
It is not possible to deallocate with sbrk in RARS. There is not a good way to allocate and deallocate memory like malloc and free. It is possible to make a memory allocator in assembly that provides C like allocation on top of sbrk.
i can't see how i can deallocate the memory that i allocated using sbrk ecall, i tried loading a negative number onto a7 and sycall it but it said negative heap amount, this is an unsafe practice because it can give others possibilities for memory leaks