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

Support out of order destruction of static_vars #83

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

AjayBrahmakshatriya
Copy link
Collaborator

@AjayBrahmakshatriya AjayBrahmakshatriya commented Oct 28, 2024

This changeset relaxes the big constraint on static_vars having to be destroyed in the exact same order as they are initialized. This was previously asserted in the destructor. However this makes returning static_vars from functions difficult due to copy elision. This change relaxes this now by simply setting the size of the variable in the tracking tuple to be 0. tracking tuples of size 0 are cleaned up lazily.
This also doesn't require us to remove the element from the middle which could mess with static_tag comparisons.

Sample58 has been added to test this.

This should also help with #76

@AjayBrahmakshatriya AjayBrahmakshatriya merged commit 8c8aba8 into BuildIt-lang:master Oct 28, 2024
1 of 2 checks passed
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

Successfully merging this pull request may close these issues.

1 participant