Re: Usage RepeatedPtrField - Advanced memory mgmt

2009-06-16 Thread Kenton Varda
Everything you say sounds right. If you want to know precisely what these methods do, or how much overhead they incur, I encourage you to look at the code in repeated_field.h -- it's not very complicated. However, instead of trying to control all this in detail, it's usually easiest to simply

Re: Usage RepeatedPtrField - Advanced memory mgmt

2009-06-16 Thread RobertFach
However, instead of trying to control all this in detail, it's usually easiest to simply make sure that you reuse your protobuf objects.  If you parse a message, clear it, and then parse another message into the same object, it will reuse the memory for sub-objects and such which was

Re: Usage RepeatedPtrField - Advanced memory mgmt

2009-06-16 Thread Kenton Varda
On Tue, Jun 16, 2009 at 10:13 AM, RobertFach robert.f...@inf.tu-dresden.dewrote: So if I understood you right, say my example message test contains 10 chunks, if I clear that message and parse another message containing 9 chunks, no allocation would be performed and 1 cleared chunk object