Re: [protobuf] Allocator Support for strings

2011-07-13 Thread Gokulakannan Somasundaram
Thanks a lot for the reply. Gokul. On Tue, Jul 12, 2011 at 3:23 PM, Pherl Liu liuj...@google.com wrote: In the common.h, we have a using namespace std;, and we use string directly in runtime libraries. However, we use ::std::string in generated file; you need to modify the proto compiler to

Re: [protobuf] Allocator Support for strings

2011-07-12 Thread Pherl Liu
In the common.h, we have a using namespace std;, and we use string directly in runtime libraries. However, we use ::std::string in generated file; you need to modify the proto compiler to support different string allocators. We do have custom allocator support in our TODO list internally, but

Re: [protobuf] Allocator Support for strings

2011-07-11 Thread Jason Hsueh
+Pherl Hm, not sure how feasible this is. The code generator emits references to ::std::string. I suppose there might be some hack like adding a typedef of ::std::string to ::protobuf::string in one of the header stubs; then you could override that (or perhaps use some kind of preprocessor macro,

Re: [protobuf] Allocator Support for strings

2011-07-08 Thread Jason Hsueh
We don't support this at this time - the primary problem is that specifying an allocator for C++ string's produces a completely new type. This means allocators can't simply be injected into a particularly message instance; instead it would have to be part of the message definition. On Wed, Jul 6,

Re: [protobuf] Allocator Support for strings

2011-07-08 Thread Gokulakannan Somasundaram
Thanks a lot for the reply. I understood that part. Currently in the .proto file, there is a string definition which gets translated to std::string. What we actually need is a typedef which can be configured as per the end user wish, before building the protobuf. But can i get some assistance on

[protobuf] Allocator Support for strings

2011-07-06 Thread Gokul
Hi, In the application, i am working on, we are managing the memory of strings using allocators. But i find that the protobuf uses strings without any allocator support. Is there a plan to provide allocator support for strings in future? Or can someone guide me on how to go about implementing