New issue 351 by tha...@chromium.org: Make protobuf_lite proto files not
create any static initializers
http://code.google.com/p/protobuf/issues/detail?id=351
We're trying to remove all static initialization from chromium:
http://crbug.com/105626
This is made harder by protoc generating a static initializer for every
protobuf, which is used to create the const reference returned by
default_instance() (we use light protobufs for everything as far as I know,
so we don't use the reflection bits).
We don't call default_instance() in chromium, so it would be nice if we
could get rid of the static initializers somehow.
Have you thought about this, or any suggestions we might go about this? I'm
willing to work on protoc to make this happen.
This issue is now blocking issue chromium:105626.
See http://code.google.com/p/chromium/issues/detail?id=105626
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
I asked a google-internal mailing list (
https://groups.google.com/a/google.com/group/protobuf-discuss/browse_thread/thread/a4a3ceb5d6e396a8
), and the suggestion was to try to use GoogleOnceInit (already in
protobuf:
http://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/stubs/once.h
).
It looks like on the Windows code path once.h still calls the
ProtobufOnceType() ctor as a static initializer.
Blind :-/ Where?
http://code.google.com/p/protobuf/source/browse/trunk/src/google/protobuf/stubs/once.h
#define GOOGLE_PROTOBUF_DECLARE_ONCE(NAME) \
::google::protobuf::ProtobufOnceType NAME
and
struct LIBPROTOBUF_EXPORT ProtobufOnceType {
ProtobufOnceType();
I am taking over this issue. Here is a first CL:
https://codereview.appspot.com/5643065/
Comment #8 on issue 351 by liuj...@google.com: Make protobuf_lite proto
files not create any static initializers
http://code.google.com/p/protobuf/issues/detail?id=351
(No comment was entered for this change.)