Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sbrk problem #200

Closed
halvbanan opened this issue Sep 22, 2023 · 1 comment
Closed

sbrk problem #200

halvbanan opened this issue Sep 22, 2023 · 1 comment

Comments

@halvbanan
Copy link

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

@TheThirdOne
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants