From: Pedro Alves <pedro@codesourcery.com>
To: gdb@sourceware.org
Cc: Michael Snyder <msnyder@vmware.com>
Subject: Re: question, xmalloc and gdbserver?
Date: Wed, 02 Mar 2011 09:40:00 -0000 [thread overview]
Message-ID: <201103020940.21789.pedro@codesourcery.com> (raw)
In-Reply-To: <4D6D8067.9090802@vmware.com>
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
next prev parent reply other threads:[~2011-03-02 9:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-01 23:25 Michael Snyder
2011-03-02 9:40 ` Pedro Alves [this message]
2011-03-02 18:31 ` Michael Snyder
2011-03-02 18:45 ` Pedro Alves
2011-03-02 19:41 ` Michael Snyder
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201103020940.21789.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=gdb@sourceware.org \
--cc=msnyder@vmware.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox