Commit 6103d4ed authored by pliard@google.com's avatar pliard@google.com
Browse files

Don't call AddDesc() at static init time in LITE_RUNTIME mode.

This patch makes the generation of StaticDescriptorInitializer_$filename$
depend on whether LITE_RUNTIME is enabled. Note that this works only when
extensions are not used.

This lets us significantly decrease the number of static initializers generated
by protoc in LITE_RUNTIME mode (used in Chromium).
In LITE_RUNTIME mode, $adddescriptorsname$() is called the first time that
default_instance() is called (rather than being called during static init).

To benefit from this patch in LITE_RUNTIME mode without extensions, compile
with -DGOOGLE_PROTOBUF_NO_STATIC_INIT.

BUG=351
parent 7cc25767
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment