question, xmalloc and gdbserver?
Pedro Alves
pedro@codesourcery.com
Wed Mar 2 09:40:00 GMT 2011
On Tuesday 01 March 2011 23:25:27, Michael Snyder wrote:
> What's the policy about using malloc vs. xmalloc in gdbserver?
> I notice both are used, with xmalloc being favored, but there are
> still quite a few calls to malloc.
I think malloc is used when a failure is not to be considered
fatal, e.g., when the size of the data is determined by the input.
Doug went through and fixed a bunch a while ago (yearly 2009).
You should be able to find the discussions around the patches
in the archives. Basically, if there's no explicit check
for NULL after malloc, then it's quite likely a new call
that went in after Doug's fixes.
--
Pedro Alves
More information about the Gdb
mailing list