-
Notifications
You must be signed in to change notification settings - Fork 0
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
Free memory in C #38
Labels
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In Rust, the memory is usually never allocated explicitly, but rather it is acquired by using standard library objects.
In C++, a similar pattern could be used, making use of STL objects (the most relevant being the
std::vector
).If we returned STL objects from Rust, we could make use of their destructors. Or we can define the
objects to acquire the memory returned from Rust.
However, in C nothing like that happens, thus we have to free the returned objects ourselves.
The text was updated successfully, but these errors were encountered: