Yes, observe:

$ cat t.cc
#include <iostream>
using namespace std;
struct foo { char b[4096]; };
int
main(void)
{
  foo *f = new foo;
  return 0;
}
$ g++ -o t t.cc -ltcmalloc
$ gdb --args ./t
GNU gdb (GDB) 7.6
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/stephentu/t...(no debugging symbols
found)...done.
(gdb) b main
Breakpoint 1 at 0x400a84
(gdb) r
Starting program: /home/stephentu/t
warning: no loadable sections found in added symbol-file system-supplied
DSO at 0x7ffff7ffa000
warning: Could not load shared library symbols for linux-vdso.so.1.
Do you need "set solib-search-path" or "set sysroot"?
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".

Breakpoint 1, 0x0000000000400a84 in main ()
(gdb) b tc_new
Breakpoint 2 at 0x7ffff7ba2c60
(gdb) c
Continuing.

Breakpoint 2, 0x00007ffff7ba2c60 in tc_new () from /usr/lib/libtcmalloc.so.4
(gdb) bt
#0  0x00007ffff7ba2c60 in tc_new () from /usr/lib/libtcmalloc.so.4
#1  0x0000000000400a95 in main ()



On Thu, Aug 8, 2013 at 8:22 PM, <proto...@googlecode.com> wrote:

>
> Comment #2 on issue 542 by leening0...@gmail.com: The memory leak problem
> http://code.google.com/p/**protobuf/issues/detail?id=542<http://code.google.com/p/protobuf/issues/detail?id=542>
>
> You means I will still use new, and it will call the tcmalloc
> automatically.
>
>
> --
> You received this message because this project is configured to send all
> issue notifications to this address.
> You may adjust your notification preferences at:
> https://code.google.com/**hosting/settings<https://code.google.com/hosting/settings>
>
> --
> 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+unsubscribe@**googlegroups.com<protobuf%2bunsubscr...@googlegroups.com>
> .
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at 
> http://groups.google.com/**group/protobuf<http://groups.google.com/group/protobuf>
> .
> For more options, visit 
> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
> .
>
>
>

-- 
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