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

ReprCString should have drop, like CVec #14

Open
kenfred opened this issue Sep 28, 2023 · 1 comment
Open

ReprCString should have drop, like CVec #14

kenfred opened this issue Sep 28, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@kenfred
Copy link

kenfred commented Sep 28, 2023

If ReprCString is analogous to Rust's String and owns its own memory, it needs a drop method just like CVec. As it is currently, passing ReprCString to the C side will leak because it has no way to free the string.

@h33p h33p added the bug Something isn't working label Dec 25, 2023
@h33p
Copy link
Owner

h33p commented Dec 25, 2023

This is true, thanks for reporting! Generally it's a bit tricky, because it's meant to kind of mimic regular C char * strings, so I'm not set whether it's a good idea to add a drop with each string, or make sure each string is allocated with malloc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants