I just wanted to confirm an approach I intend to take for decoding protobuf 
messages on an embedded system with a restricted C++ environment.

This embedded system has an object method that given a RootObj, it allows 
me to allocate x bytes by RootObj::allocate(x).  Otherwise the heap new 
operator is disallowed.
It will clean up any allocated objects on the RootObj destructor and 
RootObj always outlives any protobuf objects I create.

I am thinking a good way to go will be to change the c++ protoc 
implementation in the source code to add the RootObj& reference in the 
and whenever the current implementation has:
      [X*] ptrX = new X;
I will use
      void* buf = rootObj::allocate(sizeof(X));
      ptrX = new (buf) X;

Will that be sufficient?

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to