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

(c2rust-analyze) Support custom deallocators/linear Box types #1007

Open
kkysen opened this issue Jul 26, 2023 · 0 comments
Open

(c2rust-analyze) Support custom deallocators/linear Box types #1007

kkysen opened this issue Jul 26, 2023 · 0 comments

Comments

@kkysen
Copy link
Contributor

kkysen commented Jul 26, 2023

For custom allocator/deallocator functions other than {m,c,re}alloc and free, such as:

  • getaddrinfo and freeaddrinfo
  • open, etc. and close
  • glob and globfree
  • mmap and munmap

it would be nice to also support them like we do for the primary allocators/deallocator. As @spernsteiner said,

maybe we could handle this with an additional permission or flag that translates into a custom "linear (non-affine) box" type that must be explicitly freed with a special function (you can't just let it go out of scope).

That said, even if we don't track them correctly, memory leaks are safe, and we'll be doing the same memory management as was in C. It'd be similar to any other resource as well, like open, etc. and close.

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

1 participant