Status: New
Owner: [email protected]
Labels: Type-Defect Priority-Medium

New issue 381 by [email protected]: 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.

--
You received this message because you are subscribed to the Google Groups "Protocol 
Buffers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.

Reply via email to