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

Free memory in C #38

Open
alecandido opened this issue Jun 24, 2024 · 0 comments
Open

Free memory in C #38

alecandido opened this issue Jun 24, 2024 · 0 comments
Labels

Comments

@alecandido
Copy link
Member

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.

This was referenced Jun 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant