SIGN IN SIGN UP

Protocol Buffers - Google's data interchange format

0 0 53 C++

Minimal inlined arm64 asm memset for zero-initializing messages.

* Avoids spilling registers with a function call
* Avoids unaligned length setup that a generic memset includes, since our lengths are always a multiple of 8 bytes, and always at least 8 bytes
* Avoids PLT lookup
* Not enabled if we're compiling with MOPS support as the processor's memset will for sure be better than ours

What this loses relative to a generic arm memset is doing 32-byte store pairs of NEON registers, and not falling through to a `dc zva` loop for very large memsets. But the overwhelming quantity of messages are pretty small. If we see issues with large messages we could add a fallback path to `memset` if above a certain size.

PiperOrigin-RevId: 919938888
P
Protobuf Team Bot committed
84ee6815d69967516febaf79d9fab6f112503d22
Parent: f7c6657
Committed by Copybara-Service <copybara-worker@google.com> on 5/23/2026, 12:42:21 AM