Hi Moritz, If you subclass capnp::MesasgeBuilder, you can define your own memory allocation.
However, I think other places in the library will allocate small amounts of heap memory here and there. Maybe you could allocate a little bit of static space (e.g. 1MB would probably be plenty) and turn it into a heap? Alternatively, there is a C implementation of Cap'n Proto which may work better for embedded use cases: https://github.com/opensourcerouting/c-capnproto -Kenton On Sat, Jul 22, 2017 at 5:37 AM, <[email protected]> wrote: > Hi, > > I would love to use Cap'n Proto in an embedded environment. The main > problem is that heap allocation is not possible. However, the documentation > stated that given enough scratch space, this should be possible. Static > memory is relatively cheap, 4GB, so creating a large statically allocated > scratch space would be possible. The source mentions the use of " > MallocMessageBuilder", but there is no detailed information for heap-less > systems. > > Any pointers to experience of using Cap'n Proto in the embedded space? > > Best regards, > Moritz > > -- > 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.
