The new fields fixed_features and overridable_features can be simply merged to recover the old aggregate defaults. By splitting them though, plugins and runtimes get some extra information about lifetimes for enforcement.
PiperOrigin-RevId: 625084569
- Only call GetUtf8CheckMode once per field.
- Avoid vector reallocations in GenerateFieldNames by sizing it correctly from the start and using pointers to write to it instead of push_back.
- Stop making a temporary array of names. We cache GetUtf8CheckMode so testing for it again is cheaper.
PiperOrigin-RevId: 624986618
We will be punting on actual implementation of lifetime verification during dynamic builds, but in the future leaning towards the simplified algorithm.
PiperOrigin-RevId: 624937514
The shared tests which access `protobuf_upb` or `protobuf_cpp`
have access to more items than the `protobuf` library itself.
This is because the former don't go through the same re-exporting based
on kernel.
I fix this by creating two test-only libraries that perform the same re-exporting
as the `protobuf` library, but with the kernel explicitly set, and changing the shared
tests to reference that instead of the inner runtime library.
This is needed to reliably test macros, where item paths are relative to the invocation,
not eagerly checked at the macro source.
PiperOrigin-RevId: 624328817
The intent of this directory would be for a layer of Rust bindings that directly map to upb semantics; Rust Protobuf runtime would be layer on top of that Rust, instead of directly on the upb C api.
PiperOrigin-RevId: 624282429
--
4b67c374d49b00860a8f285aae2e064cc58a0dc7 by Bastien Jacot-Guillarmod <bjacotg@gmail.com>:
Make `ActualT` in `Matcher` a generic type parameter.
--
7e34d847f2cda5387e55ac436ded30cc6d07bcaa by Bastien Jacot-Guillarmod <bjacotg@gmail.com>:
Accept all `Copy` type for `ActualT` instead of only reference.
PiperOrigin-RevId: 624094573
Features need to be validated within the pool being built, since the generated pool only contains extensions linked into the binary (e.g. protoc or a runtime building dynamic protos). The generated pool may be missing extensions used in this proto or it may have version skew. Moving to the build pool requires reflective parsing, which in general can't be done from inside the pool's database lock. This required some refactoring to add a post-build validation phase outside of the lock.
For now, the feature support spec is optional and the checks only are only applied when it's present. Follow-up changes will add these specs to our existing features and then require them for all FeatureSet extensions.
PiperOrigin-RevId: 623630219
- For enums that are already defined in a sequential manner, use the existing info from the descriptor.
- For other enums use a bit set to find unique values instead of a vector+sort+unique. Much less work to do so, and we can use stack for it instead of heap most of the time.
PiperOrigin-RevId: 623613446
- Make FreeStringBlocks() happen inside Free() as string blocks are basically an implementation detail of SerialArena.
- Add GetDeallocator to the anonymous namespace.
- Remove a comment about the implementation of AddSpaceAllocated at one of its callsites.
PiperOrigin-RevId: 623563543
This ensures that StreamDecoder throws a InvalidProtocolBufferException instead of an IllegalStateException on some invalid input.
All other implementations of CodedInputStream already do this check.
PiperOrigin-RevId: 623383287
Move away from looking up selectors at proto initialization time to doing optimized string compares at implementation resolving time.
PiperOrigin-RevId: 623183331