Skip to content

Conversation

@khaledhosny
Copy link
Contributor

I had assumed that memory allocated with stackAlloc() would be automatically released when the function returns, but it seems that I need to use stackSave()/stackRestore() to release the memory.

I wonder if stackAlloc() has now any benefits at all over malloc() if one has to manually release the memory. Well at least I have to release it once per function, not for each allocation.

I had assumed that memory allocated with stackAlloc() would be
automatically released when the function returns, but it seems that I
need to use stackSave()/stackRestore() to release the memory.

I wonder if stackAlloc() has now any benefits at all over malloc() if
one has to manually release the memory. Well at least I have to release
it once per function, not for each allocation.
@khaledhosny khaledhosny merged commit cb5697b into main Jan 27, 2026
2 checks passed
@khaledhosny khaledhosny deleted the memory-leaks branch January 27, 2026 16:20
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

Successfully merging this pull request may close these issues.

1 participant