This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Memory leaks in cplus-dem.c


I'm tracking down some bugs in which GDB consumes excessive memory.  One of
them is definitely foolishness in how ofter we call the demangler, but in
fixing that I've discovered that the demangler itself leaks memory.  Calling
cplus_demangle with DMGL_ARM | DMGL_ANSI and this string, for example:

_M_get_node__t19_Rb_tree_alloc_base3Zt4pair2ZCt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0Zt3map4Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0ZsZt4less1Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0Zt9allocator1ZsZt9allocator1Zt3map4Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0ZsZt4less1Zt12basic_string3ZcZt18string_char_traits1ZcZt24__default_alloc_template2b1i0Zt9allocator1Zsb1

leaks about 4K every time, above and beyond the malloc'd return value. 
Anyone have an idea why?

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]