-
Notifications
You must be signed in to change notification settings - Fork 300
Use nifty counter idiom for SIOF #2059
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Does this PR add a regression test?
aligned_storage is deprecated and should never be used. You can use an anonymous union with a single type instead.
https://stackoverflow.com/questions/71828288/why-is-stdaligned-storage-to-be-deprecated-in-c23-and-what-to-use-instead
For regression testing, we can replace our use of Line 211 in 3d86275
with a |
So the way this works is:
I think this can work! Thanks @isuruf for implementing it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good. Is my understanding at #2059 (comment) correct?
Yep.
It gets called when each translation unit gets unloaded and when all translation units are unloaded, the expression is freed. This happens when the program terminates or if we opened the library using |
@isuruf excellent. (I wasn't sure if this happens when the program terminates, since the OS cleans the memory anyway.) |
Fixes #2057