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

Add "destructor" hooks for custom types #1692

Open
hugrbot opened this issue Nov 25, 2024 · 0 comments
Open

Add "destructor" hooks for custom types #1692

hugrbot opened this issue Nov 25, 2024 · 0 comments
Assignees
Labels
llvm Pertains to LLVM emission

Comments

@hugrbot
Copy link
Collaborator

hugrbot commented Nov 25, 2024

Originally raised by @doug-q:

Some types need to run code when they are freed, for example smart pointers decrementing their reference counts. This means all types need the opportunity to register a destructor, because they may contain a (for example) smart pointer.

We should provide a destructor for sum types, which recursively invokes the destructor of each field of the variant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
llvm Pertains to LLVM emission
Projects
None yet
Development

No branches or pull requests

2 participants