Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb-patches@sourceware.org
Subject: Re: RFA: fix minor memory leak in symfile.c
Date: Sat, 13 Sep 2008 17:58:00 -0000	[thread overview]
Message-ID: <m37i9gudzh.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20080913171723.GH3714@adacore.com> (Joel Brobecker's message of "Sat\, 13 Sep 2008 10\:17\:23 -0700")

>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:

>> While auditing other callers of build_id_bfd_get, I found a use of
>> 'free', so I fixed that as well.  (Perhaps we ought to poison "free"?)

Joel> I think that's a good idea, since I don't think there is any case
Joel> besides the xfree implementation where we want to call free. Same
Joel> for malloc as well.  But I'm not very familiar with the pros and
Joel> cons of this GCC pragma.

It works in the lexer, so it is fairly primitive.

I tried it and ran into a few problems.  vec.h uses the token
'free'.  struct dict_vector has a field named 'free'.  And, bison uses
'free', but IIRC we #define it to xfree somewhere.

So, I think this probably isn't worth pursuing.

I did find a few stray uses of free.  I can send that patch if you
like.  I'm not even sure if this matters -- I suppose the
justification for xfree is not as strong as that for xmalloc.

Tom


  reply	other threads:[~2008-09-13 17:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-13 17:00 Tom Tromey
2008-09-13 17:08 ` Daniel Jacobowitz
2008-09-13 17:18 ` Joel Brobecker
2008-09-13 17:58   ` Tom Tromey [this message]
2008-09-13 22:35     ` Joel Brobecker
2008-09-13 22:53       ` Tom Tromey
2008-09-13 23:04         ` Joel Brobecker
2008-09-13 23:47           ` Mark Kettenis
2008-09-14 23:09         ` Thiago Jung Bauermann
2008-09-15  0:06           ` Tom Tromey
2008-09-18  1:04           ` Joel Brobecker
2008-09-18  2:31             ` Daniel Jacobowitz

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=m37i9gudzh.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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