Hi,
is there anybody out there who can tell me how the special methods
like addcleared(), etc. for repeated field ptr work?
I guess I can somehow improve/avoid the allocation overhead, right?
Say, I have the following messages,
message test {
repeated chunk = 1;
}
message chunk {
int value = 1;
}
The goal is to reduce the memory allocations by using pre-allocated
objects.
Assume the chunkPtr points to an already allocated object, if I use
test.chunk().addAllocated(chunkPtr), does it just attaches the
chunkPtr to the reaptedFieldPtr chunk object? Is there any overhead
incured by dynamically adding the chunks to the test message? Can I
deal with that issue by using the test.chunk().Reserve(xx) method?
It seems also that I can maintain a pool of objects by using the
addCleared() method, right? This way, future calls to test.chunk().add
() will use an element from the pool?
I was just wondering about these questions while reading the
documentation... maybe you can just tell me if this usage pattern
would be ok.
Thx for the library and thx for the support
Cheers Robert
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
Protocol Buffers group.
To post to this group, send email to protobuf@googlegroups.com
To unsubscribe from this group, send email to
protobuf+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/protobuf?hl=en
-~--~~~~--~~--~--~---