Dynamic data in capnproto

234 views
Skip to first unread message

al.z....@gmail.com

unread,
Nov 18, 2019, 7:56:35 PM11/18/19
to Cap'n Proto
Is it possible to use capnproto with "dynamic" data. I.e. for instance push/delete data to/from list. In other word can one use capnproto as c++ stl?

Kenton Varda

unread,
Nov 18, 2019, 7:59:19 PM11/18/19
to al.z....@gmail.com, Cap'n Proto
Hi,

Cap'n Proto is not a good format for mutable in-memory structures. Lists cannot dynamically resize, and if you remove an object the space allocated for it is not freed (until you free the entire message). This is due to Cap'n Proto's use of arena-style allocation which is necessary to allow for zero-copy I/O.

This is covered in the docs in the "Tips and Best Practices" section here:

-Kenton

On Mon, Nov 18, 2019 at 4:56 PM <al.z....@gmail.com> wrote:
Is it possible to use capnproto with "dynamic" data. I.e. for instance push/delete data to/from list. In other word can one use capnproto as c++ stl?

--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/capnproto/8f78115c-bb91-49f5-9c73-8b3ea09edf7b%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages