Hi Stephen,

If you want to correct for the "leak" (useless zero bytes in the middle of
your message), what you can do is create a new MessageBuilder and then copy
the old message into the new builder. The copy has the effect of compacting
the message by only copying the parts that are actually reachable from the
root.

-Kenton

On Wed, Jun 1, 2016 at 7:57 AM, Stephen Shirley <[email protected]> wrote:

> Hi,
>
> I'm working on converting a service to capnp. In a number of cases, i
> need to be able to add items to the lists in a received capnp message
> before forwarding it. I'm using pycapnp, so i'm using the
> .as_builder() method to give me a mutable object. What i have been
> doing is saving the existing list to a temp variable, calling init on
> the list with the new length, and then copying the items back in. The
> capnp docs state that calling init() on an existing field will leak
> memory, so i'm not sure what i should in fact be doing instead. Any
> suggestions?
>
> Steve
> --
> "You are technically correct, the best kind of correct."
> - Bureaucrat 1.0, Futurama
>
> --
> 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 [email protected].
> Visit this group at https://groups.google.com/group/capnproto.
>

-- 
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 [email protected].
Visit this group at https://groups.google.com/group/capnproto.

Reply via email to