protobuf-c zero allocation

203 views
Skip to first unread message

Julien PONNOU

unread,
Aug 2, 2012, 12:06:56 PM8/2/12
to prot...@googlegroups.com
Hello,

I'm using the C version of protobuf. I'm wondering if there is a way to not allocate memory dynamically to serialize/deserialize a message. In other words, is there a "ZERO ALLOCATION" method to use it ?

Best regards,

Julien.

jpa

unread,
Aug 4, 2012, 7:12:47 AM8/4/12
to prot...@googlegroups.com
You could use nanopb, which uses only static allocation:

--
Petteri Aimonen

Julien PONNOU

unread,
Aug 8, 2012, 8:54:08 AM8/8/12
to prot...@googlegroups.com
Hello,

I've heard we can avoid dynamic allocation using a specific allocator instead of the default one. Does somebody have an example ?

Best regards,

Julien.

hailong zhao

unread,
Aug 28, 2014, 7:49:58 PM8/28/14
to prot...@googlegroups.com
i also hv the same question. 

在 2012年8月3日星期五UTC+8上午12时06分56秒,Julien PONNOU写道:

Robert Edmonds

unread,
Aug 28, 2014, 11:14:51 PM8/28/14
to prot...@googlegroups.com
Hi,

This is the "protobuf" discussion group. For "protobuf-c", see:

https://groups.google.com/forum/#!forum/protobuf-c

In answer to your question, protobuf-c requires dynamic memory
allocation to deserialize a message. If you are trying to avoid memory
allocation, you may be interested in the "nanopb" implementation
instead:

http://koti.kapsi.fi/jpa/nanopb/
--
Robert Edmonds
Reply all
Reply to author
Forward
0 new messages