This change implements the existing 'Align*' logic in terms of `arena_align.h` enabling further cleanups and a long needed split of arena_impl.h into serial_arena.h and thread_safe_arena.h. The latter reduces the cost of adding new features or optimizations to arena.
PiperOrigin-RevId: 494259282
In particular, this allows for configuring what the "consume after" characters that follow
a $...$ are, which previously were ";," for callback subs and "" for everything else.
In a followup the three-argument constructor for Sub will be removed and replaced with
calls to Annotate().
Also, calls to WithVars still reject closure arguments, but this check happens at runtime
now. This is a minor papercut for users that simplifies the implementation of Sub and
related private types immensely.
PiperOrigin-RevId: 494254545
This change extracts the existing tokenization logic into one function and
tweaks it slightly, making it easier to understand how format strings are tokenized
at the cost of a few allocations.
Most of the changes in generated code are due to slight changes in how indentation are handled that harmlessly confuse some odd uses of cpp::Formatter; Emit() is not impacted.
PiperOrigin-RevId: 494193350
This generates Messages and Enums into separate files, this is the start of some
exploratory work to see if not using `-ObjC` with the linker can reduce the size
of protos by ensuring there are linker references for all the classes needed.
To take advantage of this, the Application code can't use things like
`NSClassFromString`, as that would not generate any inker reference for usage of
the class.
Again, this is an experimental feature and may change or be removed at any time,
it is not counted as a part of the official options provided by the ObjC
support.
PiperOrigin-RevId: 493595005
Add missing header <istream> and <ostream>
Remove unneeded proto headers repeated_field.h and generated_message_util.h
Remove unnecessary conversion when calling absl::Hex
Use StrCat rather than repeated string addition
Use string_view parameter rather than `const char *`
Make single-argument constructor explicit
Use consistent InitializationErrorMessage logic
Fix a typo
PiperOrigin-RevId: 493427054
Replace access to variables created in globals() by explicit access to the globals() array. This avoids static analysis of the code to error out on those unknown variables, and make the files cythonable.
Fixes#10800Closes#11011
COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/11011 from vthib:10800-cython-compatibility 705da40d5c
PiperOrigin-RevId: 493379473