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 arrays #117

Open
gasche opened this issue May 11, 2017 · 0 comments
Open

free arrays #117

gasche opened this issue May 11, 2017 · 0 comments

Comments

@gasche
Copy link
Collaborator

gasche commented May 11, 2017

Right now, arrays are never freed. I first thought it was reasonable (heap locations allocated by mutable variables where never freed either, and the (reasonable) idea was to imagine that we had a GC), but if we start having heap-heavy tests like linked lists it would make sense to start thinking of freeing heap-allocated arrays.

We could have a free x instruction that would deallocate the array memory, but then other people that would have the array value at hand would fail on access. There is no really nice semantics there. I would be inclined to just have accesses/assignments to freed arrays get stuck; we could also have a valid(x) operator that returns true if the array still exists, and try to speculatively remove these tests.

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