SIGN IN SIGN UP

Protocol Buffers - Google's data interchange format

0 0 35 C++

Removed indirection for sub-messages.

To do this, we use `__attribute__((weakref()))` to weakly reference a placeholder definition for tree shaken sub-messages.  This provides the same tree shaking behavior we had before, but without needing an extra indirection.  If we had discovered this technique before, we would have had no reason to add the indirection in cl/640369522.

This will reduce the code size and memory overhead of any MiniTables with sub-messages in them, because we no longer need an extra `void*` per sub-message field to store the extra indirect pointer.

It also should improve efficiency a bit since there is one fewer indirection when recursing into a sub-message field.

PiperOrigin-RevId: 829022414
J
Joshua Haberman committed
1a54fdb2c318d54b1f32dbabbcd0936d4adaf049
Parent: 2224cbb
Committed by Copybara-Service <copybara-worker@google.com> on 11/6/2025, 6:55:15 PM