-
Notifications
You must be signed in to change notification settings - Fork 39
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
Performance and Safety Improvements #93
Conversation
These changes would both be welcome! Thank you raising the PR.
As for this change, the use of |
b6d1214
to
0acf989
Compare
I had provided a common alternative to I have removed the static asserts. |
I see why the static_assert failed, the error string had spaces in it. Regardless, the latest commit has no static asserts so they are ready for review. |
/bot run formatting |
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.
Approved! Thank you for submitting this PR and making the requested changes.
Trust me - sometimes we feel that deeply as well. Backwards compatibility - while extremely important - can be a pain when new features simplify your life. |
This PR includes 3 changes I consider important. They are well separated so you can cherrypick out commits that you don't consider beneficial. I am happy to make any changes that help with code conformity.
Change 1:
Define arrays as static to avoid copy to stack.
Change 2:
Use Macro function for string literal length calculation, avoids off by 1 errors.
Change 3:
Introduce asserts for function parameters that can overflow. Also included
static_assert
definitions to help with co-dependent array declarations.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.