Issue 351 in protobuf: Make protobuf_lite proto files not create any static initializers

已查看 45 次
跳至第一个未读帖子

prot...@googlecode.com

未读,
2011年12月1日 21:41:262011/12/1
收件人 prot...@googlegroups.com
Status: New
Owner: liuj...@google.com
Labels: Type-Defect Priority-Medium

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.

prot...@googlecode.com

未读,
2011年12月1日 21:45:282011/12/1
收件人 prot...@googlegroups.com
Issue 351: Make protobuf_lite proto files not create any static initializers
http://code.google.com/p/protobuf/issues/detail?id=351

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

prot...@googlecode.com

未读,
2012年1月16日 16:03:362012/1/16
收件人 prot...@googlegroups.com

Comment #2 on 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

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
).

prot...@googlecode.com

未读,
2012年2月6日 13:00:062012/2/6
收件人 prot...@googlegroups.com

Comment #4 on issue 351 by ev...@chromium.org: Make protobuf_lite proto
files not create any static initializers
http://code.google.com/p/protobuf/issues/detail?id=351

It looks like on the Windows code path once.h still calls the
ProtobufOnceType() ctor as a static initializer.

prot...@googlecode.com

未读,
2012年2月6日 13:40:322012/2/6
收件人 prot...@googlegroups.com

Comment #5 on 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

Blind :-/ Where?

prot...@googlecode.com

未读,
2012年2月6日 14:13:442012/2/6
收件人 prot...@googlegroups.com

Comment #6 on issue 351 by ev...@chromium.org: Make protobuf_lite proto
files not create any static initializers
http://code.google.com/p/protobuf/issues/detail?id=351

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();

prot...@googlecode.com

未读,
2012年2月8日 17:57:502012/2/8
收件人 prot...@googlegroups.com

Comment #7 on issue 351 by pli...@google.com: Make protobuf_lite proto
files not create any static initializers
http://code.google.com/p/protobuf/issues/detail?id=351

I am taking over this issue. Here is a first CL:
https://codereview.appspot.com/5643065/

prot...@googlecode.com

未读,
2012年3月2日 13:30:462012/3/2
收件人 prot...@googlegroups.com
Updates:
Owner: pli...@google.com

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.)

prot...@googlecode.com

未读,
2012年5月31日 15:24:492012/5/31
收件人 prot...@googlegroups.com

Comment #9 on 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

Fixed, right?

prot...@googlecode.com

未读,
2012年6月1日 03:49:252012/6/1
收件人 prot...@googlegroups.com
Updates:
Status: Fixed

Comment #10 on issue 351 by pli...@google.com: Make protobuf_lite proto
files not create any static initializers
http://code.google.com/p/protobuf/issues/detail?id=351

Yes, finally :)

回复全部
回复作者
转发
0 个新帖子