Issue 381 in protobuf: Do not use heap where stack can be used

110 visualizzazioni
Passa al primo messaggio da leggere

prot...@googlecode.com

da leggere,
3 apr 2012, 11:00:3503/04/12
a prot...@googlegroups.com
Status: New
Owner: liuj...@google.com
Labels: Type-Defect Priority-Medium

New issue 381 by NN14...@gmail.com: Do not use heap where stack can be
used
http://code.google.com/p/protobuf/issues/detail?id=381

In generated code you see following lines:

ImportMessageLite::default_instance_ = new ImportMessageLite();
Message1::default_instance_ = new Message1();
Message2::default_instance_ = new Message2();
...

Instead of heap a stack can be used with placement new trick.
Same as boost::optional does
http://www.boost.org/doc/libs/1_49_0/libs/optional/doc/html/index.html
You can adapt this method and decrease heap fragmentation.

prot...@googlecode.com

da leggere,
3 lug 2012, 02:50:4303/07/12
a prot...@googlegroups.com
Updates:
Labels: -Type-Defect Type-Enhancement

Comment #1 on issue 381 by liuj...@google.com: Do not use heap where stack
Marked as feature request.

prot...@googlecode.com

da leggere,
5 dic 2012, 17:20:4105/12/12
a prot...@googlegroups.com

Comment #2 on issue 381 by liu...@google.com: Do not use heap where stack
I'm looking back on the pending issues. Can you clarify what you are
proposing? How can we make this on to stacks? Do you mean we should define
static char[], and use placement new?

prot...@googlecode.com

da leggere,
7 dic 2012, 04:11:5807/12/12
a prot...@googlegroups.com

Comment #3 on issue 381 by NN14...@gmail.com: Do not use heap where stack
Yes.
You can also copy boost::optional implementation :)

prot...@googlecode.com

da leggere,
14 ott 2014, 21:32:1714/10/14
a prot...@googlegroups.com
Updates:
Status: WontFix
Owner: xiaof...@google.com

Comment #4 on issue 381 by xiaof...@google.com: Do not use heap where stack
can be used
https://code.google.com/p/protobuf/issues/detail?id=381

(No comment was entered for this change.)

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
Rispondi a tutti
Rispondi all'autore
Inoltra
0 nuovi messaggi