-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix #14655 setLen(seq) now zeros memory #14656
Conversation
@Araq any word on proposal #14655 (comment) ? |
If you are going to zero by default (which is fine), you should either soon or someday provide a |
I'm fine with noInit, the only downside being that double negation is less readable than noInit. The important thing is we have that optimization escape hatch available. |
Additional remark: A better design for |
what would be benefits (besides the intent one where you call shrink if you expect it to shrink, but I haven't run into a case where this mattered)? honest question |
At the implementation level, less safe While you might balk at I agree the double negative is slightly more cognitive load than ideal, but initialized is safer than uninitialized. So, we are stuck with Similarly, whatever is done, it should be "similar", for All just food for thought. Not sure what the best answers are. |
You don't need |
1st commit is just a refactor
2nd commit is the bugfix
after PR
implement proposal in #14655 (comment)