-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Size verifier fix 2 #8740
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
base: master
Are you sure you want to change the base?
Size verifier fix 2 #8740
Conversation
In particular change all the places in the Flatbuffers library and generated code that were using `Verifier` to instead use `VerifierTemplate<TrackBufferSize>` and wrap them all inside `template <bool TrackBufferSize = false>`. Also add unit tests for SizeVerifier.
|
this looks fine, I'm curious why you chose to template on the bool and not on the verifier everywhere though |
I chose to template on the bool since that's the minimum amount of generality needed to cover the cases we want to support; since this is a broadly visible API, I prefer to avoid unnecessary generality in the API which might overly constrain the future evolution of the implementation. Also, if we template on the verifier, then to do it well, we need to be careful about documenting exactly which properties |
|
All makes sense. Thank you for sharing your decision and analysis! |
|
Looks like the generated code must be out dated? |
dbaileychess
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.
I think its fine as its fixing something. A little verbose now with all the template parameters, I left one comment about maybe shortening it.
I think we should independently look at how the VerifierTemplate base is working, as the size calculation is only affecting a few methods, I'm not totally seeing why the whole class needs to be templated. But we can discuss elsewhere.
cf35ff1 to
38736a5
Compare
I think that should be fixed now. Please take another look. |
Fixes to make SizeVerifier work, to fix #8579.
In particular change all the places in the Flatbuffers library
and generated code that were using
Verifierto instead useVerifierTemplate<TrackBufferSize>and wrap them all insidetemplate <bool TrackBufferSize = false>.Also add unit tests for SizeVerifier.