-
Notifications
You must be signed in to change notification settings - Fork 29
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
capi: Add object sizes to input types #505
Conversation
With an upcoming change the blazesym-c crate will also optionally generate additional artifacts as part of its build. To prevent these files from causing unnecessary rebuilds, make sure to adjust their modified time stamps accordingly. Please refer to commit c0c3afb ("Eliminate unnecessary rebuilds in build script") for all details. Signed-off-by: Daniel Müller <deso@posteo.net>
In order to ensure some level of forward & backward compatibility, this change extends all our input types with a member holding the object type's size. Users need to set this member to the size of the type. The library can then ignore unsupported fields (forward compatibility) or provide reasonable defaults for fields not provided (backward compatibility). Signed-off-by: Daniel Müller <deso@posteo.net>
Because blazesym-c aims to be forward compatible, it needs to accept objects that are larger (i.e., anticipate extensions) than what the library currently defines. However, the library should not attempt to satisfy a request that has options present that it does not understand. To enforce this constraint, put in some checks that make sure that any bytes past the last currently defined member (but captured by the type_size field) are set to zero. Signed-off-by: Daniel Müller <deso@posteo.net>
To allow for a limited set of future extensions, make sure to reserve some unused space in various output related data types. Signed-off-by: Daniel Müller <deso@posteo.net>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #505 +/- ##
==========================================
- Coverage 93.53% 93.50% -0.04%
==========================================
Files 45 45
Lines 7980 8203 +223
==========================================
+ Hits 7464 7670 +206
- Misses 516 533 +17 ☔ View full report in Codecov by Sentry. |
Well, let me add logic for checking for zero "extensions" as well... |
This should be ready for review now. Can you please take a look @anakryiko ? |
I addressed first set of comments (pertaining |
Comments should have been addressed now. Can you please take another look when you get a chance, @anakryiko ? |
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.
alright, thanks! LGTM.
Apparently the nightly toolchain in recent versions has some bug pertaining handling of the stdsimd feature. Pin the version we use to a known good one for the time being and until this issue is resolved. Signed-off-by: Daniel Müller <deso@posteo.net>
In order to ensure some level of forward & backward compatibility, this change extends all our input types with a member holding the objects size. Users need to set this member to the size of the type. The library can then ignore unsupported fields (forward compatibility) or provide reasonable defaults for fields not provided (backward compatibility).