Correct, setting a field with a primitive type will not allocate
additional space.

-Ian

Quoting vlov...@gmail.com (2020-04-16 16:53:46)
>    I don't see this explicitly called out
>    in� [1]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
>
>    --
>    You received this message because you are subscribed to the Google
>    Groups "Cap'n Proto" group.
>    To unsubscribe from this group and stop receiving emails from it, send
>    an email to [2]capnproto+unsubscr...@googlegroups.com.
>    To view this discussion on the web visit
>    [3]https://groups.google.com/d/msgid/capnproto/7b2db4bb-f017-43ec-933f-
>    939f11246e2d%40googlegroups.com.
>
> Verweise
>
>    1. https://capnproto.org/cxx.html
>    2. mailto:capnproto+unsubscr...@googlegroups.com
>    3. 
> https://groups.google.com/d/msgid/capnproto/7b2db4bb-f017-43ec-933f-939f11246e2d%40googlegroups.com?utm_medium=email&utm_source=footer

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capnproto+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/158707272403.24198.10642519008350300847%40localhost.localdomain.

Reply via email to