[protobuf] Invalid free() / delete / delete[]

2009-11-24 Thread Vlad
When I link protobuf library on linux suse to empty program valgrind starts to complain about: ==26306== Invalid free() / delete / delete[] ==26306==at 0x4A1F99E: free (vg_replace_malloc.c:323) ==26306==by 0x6467D1A: free_mem (in /lib64/libc-2.4.so) ==26306==by 0x6467991:

[protobuf] Is there a way to pass C string without triggering construction of string object in C++?

2010-01-07 Thread Vlad
There is an overhead in creating string object from the message. It is more faster to obtain direct pointer to the data and length of it. inline bool has_name() const; inline void clear_name(); static const int kNameFieldNumber = 1; inline void set_name(const ::std::string value);

[protobuf] Re: Is there a way to pass C string without triggering construction of string object in C++?

2010-01-08 Thread Vlad
:00 pm, Evan Jones ev...@mit.edu wrote: On Jan 7, 2010, at 17:41 , Vlad wrote:  inline const ::std::string name() const;  //problem here need creation of string - very slow! This doesn't create a string, it just returns a reference to the   string already in the protocol buffer object. If you

[protobuf] Re: Is there a way to pass C string without triggering construction of string object in C++?

2010-01-08 Thread Vlad
Cool Will do. thanks On Jan 8, 12:44 pm, Kenton Varda ken...@google.com wrote: On Fri, Jan 8, 2010 at 5:48 AM, Vlad vladimir.sakha...@gmail.com wrote: You can add mass assignment to your array operations and that would keep you design intact and complete array operation needs

[protobuf] Re: Is there a way to pass C string without triggering construction of string object in C++?

2010-01-08 Thread Vlad
(*zz); } but it still has 2 pages of assembler in front of it. (g++ 4.1.2 with -O2) On Jan 8, 1:45 pm, Vlad vladimir.sakha...@gmail.com wrote: Cool Will do. thanks On Jan 8, 12:44 pm, Kenton Varda ken...@google.com wrote: On Fri, Jan 8, 2010 at 5:48 AM, Vlad vladimir.sakha...@gmail.com

[protobuf] Re: Is there a way to pass C string without triggering construction of string object in C++?

2010-01-08 Thread Vlad
(*zz); } but it still has 2 pages of assembler in front of it. (g++ 4.1.2 with -O2) On Jan 8, 1:45 pm, Vlad vladimir.sakha...@gmail.com wrote: Cool Will do. thanks On Jan 8, 12:44 pm, Kenton Varda ken...@google.com wrote: On Fri, Jan 8, 2010 at 5:48 AM, Vlad vladimir.sakha...@gmail.com

[protobuf] Re: Is there a way to pass C string without triggering construction of string object in C++?

2010-01-08 Thread Vlad
(*zz); } but it still has 2 pages of assembler in front of it. (g++ 4.1.2 with -O2) On Jan 8, 1:45 pm, Vlad vladimir.sakha...@gmail.com wrote: Cool Will do. thanks On Jan 8, 12:44 pm, Kenton Varda ken...@google.com wrote: On Fri, Jan 8, 2010 at 5:48 AM, Vlad vladimir.sakha...@gmail.com