Besides unnecessary inconsistency on our C symbols, double underscores anywhere in the name are reserved for stdlib use. In practice its unlikely these symbols would ever hit a collision problem (maybe the prior name 'utf8_debug_string' with no prefix as having some risk), but safer to just standardize on this and have no concerns going forward.
PiperOrigin-RevId: 648709299
runtime that does not change observable behavior of the APIs. For example, fast-vs-slow path decisions.
Has to be turned on at compile time, and otherwise it is a noop.
PiperOrigin-RevId: 648412330
make the TcParseTable point to the ClassData.
This will allow the parser to use more information from the class in the
future.
PiperOrigin-RevId: 648377537
`GPBUnknownFields` will be the eventually replacement for `GPBUnknownFieldSet`. This
introduces the type and the changes to `GPBUnknownField`.
The new api will preserve the wire ordering of unknown fields. This is now checked
in conformance tests.
While this adds the type changes and tests them, it does not yet wire the changes
in to the rest of the Runtime, so the conformance tests still done pass.
`GPBUnknownFieldSet` also hasn't been deprecated yet, that will come in later with
the wiring in to the runtime.
PiperOrigin-RevId: 648361455
This should significantly reduce the size of large arenas. Previously, a large arena would nearly double in size if the most recent block filled up. This could end up wasting large amounts of memory. After this CL, we will waste at most the max block size, which defaults to 32k.
This more or less matches the behavior of the C++ arena.
PiperOrigin-RevId: 647802280
Export `PrivacyInfo.xcprivacy` file to allow users of protobuf to access the file from Bazel, e.g. to bundle it with an iOS application.
Closes#17054
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/17054 from mjburghard:export-privacy-manifest 4869cabc3d
PiperOrigin-RevId: 647791805
- In most cases, migrate to `absl::string_view`.
- When capturing a temporary string in a variable, use `const std::string` without the ref.
We avoid changing virtual function parameters in this CL, since that is a breaking change.
PiperOrigin-RevId: 647686085
error message from Dynamic/DownCastMessage when trying to downcast a
DynamicMessage to a generated type.
Previously the error message would say "can't down cast Foo to Foo", which is
confusing.
PiperOrigin-RevId: 647363909
**Description**
Added a cmake option to enable Unity builds for libprotobuf-lite.
Added missing symmetric include for port_def.inc
Added preproc guards for PROTOBUF_PRAGMA_INIT_SEG so it does not get included multiple times in unity build.
**Motivation and Context**
For large code base, especially in the game dev industry, Unity builds (https://en.wikipedia.org/wiki/Unity_build) are used to speed up the compilations.
Special care must be taken to enable Unity builds for a project, since many translation units will be merged togheter.
Closes#16454
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/16454 from jslap-ubi:enable-unity-build a387ffd862
PiperOrigin-RevId: 646581094
Since maps have a different in-memory representation than repeated messages, it is not safe to tree shake map entry messages.
Specifically, map fields use `kUpb_FieldMode_Map` instead of `kUpb_FieldMode_Array`, and there is no easy way to get the linker to rewrite this when the map entry is dropped.
However it is safe to tree shake message typed map values, since these use `kUpb_FieldMode_Scalar`, which remains valid even after the type is tree shaken.
PiperOrigin-RevId: 646199050
Python dict is now able to be assigned (by create and copy, not reference) and compared with the Protobuf Struct field.
Python list is now able to be assigned (by create and copy, not reference) and compared with the Protobuf ListValue field.
example usage:
dictionary = {'key1': 5.0, 'key2': {'subkey': 11.0, 'k': False},}
list_value = [6, 'seven', True, False, None, dictionary]
msg = more_messages_pb2.WKTMessage(
optional_struct=dictionary, optional_list_value=list_value
)
self.assertEqual(msg.optional_struct, dictionary)
self.assertEqual(msg.optional_list_value, list_value)
PiperOrigin-RevId: 646099987
We change InferLegacyProtoFeatures to set ctype based on string_type when string_type is set. We need to update CppGenerator::ValidateFeatures to allow both ctype and string_type to be set because it runs after InferLegacyProtoFeatures.
PiperOrigin-RevId: 645480157
When compiling the upb codebase, I randomly noticed there was one usage of directly calling `longjmp` though it seems the convention is to use the `UPB_LONGJMP` macro. AFAICT, the macro is mostly a wrapper to improve behavior on MacOS, so this may improve behavior there, otherwise it should be just making the code more consistent.
Closes#17201
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/17201 from anuraaga:patch-1 14cc027ef2
PiperOrigin-RevId: 645420330