I don't see this explicitly called out in
https://capnproto.org/cxx.html but I just wanted to double-check that something like this:
capnp::MallocMessageBuilder builder;
auto msg = builder.initRoot<MyMessage>();
auto nested = msg.initSomeStruct();
for (int i = 0; i < 100000; i++) {
nested.setField(i);
write over the wire(nested);
}
Doesn't cause arena allocation & the serialized wire size is going to be constant for all messages (i.e. it's going to continue clobbering the existing space for that field). It sounded like the only situation
was around re-initializing an existing struct or copying messages in. Just wanted to make sure that my understanding is correct & setting non-pointer fields is fine. I imagine that probably lists of
primitives are immune to this.
Thanks,
Vitali