A couple of uses of xmalloc and xfree in a couple of .y files

Joel Brobecker brobecker@adacore.com
Sat Oct 25 15:54:00 GMT 2008


> 2008-10-25  Pedro Alves  <pedro@codesourcery.com>
> 
> 	* Makefile.in (.y.c, .l.c): sed free to xfree.

I think it would be useful. The nice thing about using xmalloc/xfree etc
is that it could be turned into a poor man's memory tracking device.
I worked on a double-deallocation problem on Windows once, and all the
tools I tried out there simply were not able to handle the size of my
project. With xfree/xmalloc etc, I could augment their implementation
to log every memory allocation/deallocation from GDB. It won't be
perfect, but it might help narrow down where to look.

-- 
Joel



More information about the Gdb-patches mailing list