-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Use memset in even more cases #1273
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
Use memset in even more cases #1273
Conversation
|
I pushed a merge to |
Looks good |
Co-authored-by: Casey Carter <cartec69@gmail.com>
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.
LGTM! Thanks for the extra test coverage.
StephanTLavavej
left a comment
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.
Thanks for implementing this optimization! I found one bug involving floating-point negative zero, but otherwise this looks very solid.
Co-authored-by: Stephan T. Lavavej <stl@nuwen.net>
`static_cast<_Ty>(0)` emits this warning for object pointers, function pointers, and `nullptr_t`. We can avoid this warning by using empty braces to request zero-initialization.
|
Looks great! I've pushed three small changes (FYI @CaseyCarter) and merged with
|
|
Thanks again for this optimization, automatically making user code faster! This will ship in VS 2019 16.9 Preview 2. 🎉 |
Another small PR to optimize
(ranges::)(uninitialized_)fill(_n). I applied the optimization only to the_HAS_IF_CONSTEXPRbranch because withoutif constexprit becomes very tricky to implement and I don't know how long the!_HAS_IF_CONSTEXPRbranch will live. Part of #431.