public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Tom Tromey <tom@tromey.com>, Guinevere Larsen <blarsen@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] gdbserver: add client_state destructor
Date: Fri, 3 May 2024 17:14:20 +0100	[thread overview]
Message-ID: <c2245f3b-3ffb-4707-8ba9-9ccd2ea55746@palves.net> (raw)
In-Reply-To: <877cgaexgi.fsf@tromey.com>

On 2024-05-03 16:17, Tom Tromey wrote:
>>> At some point we went through the tree and removed all these IIRC.
> 
> Guinevere> I think I have a case of friday brains. You mean removed all nullptr
> Guinevere> checks, or removed unnecessary xfrees?
> 
> Sorry.  All the checks of null before free were removed at some point.
> 
> Though I see that gdb-xfree.h still does the check.  Lol.
> IIRC, the gnulib folks looked into this and concluded that no existing
> system requires the check before a call to free.

That is the original point of xfree existing.  It was needed on some ancient
Solaris, IIRC.  It's free didn't work right with a null argument.

Note that bfd uses xmalloc, but does not use xfree, so all such hosts are surely
gone.

Nowadays, having xfree is still important for the POD checking, of course,
and it's nice to have xmalloc/xfree for balance IMHO, thought that's of course
debatable.


  reply	other threads:[~2024-05-03 16:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-03 12:29 Guinevere Larsen
2024-05-03 13:21 ` Keith Seitz
2024-05-03 13:31 ` Tom Tromey
2024-05-03 13:33   ` Guinevere Larsen
2024-05-03 15:17     ` Tom Tromey
2024-05-03 16:14       ` Pedro Alves [this message]
2024-05-03 17:00         ` Simon Marchi
2024-05-20 16:54           ` Guinevere Larsen

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=c2245f3b-3ffb-4707-8ba9-9ccd2ea55746@palves.net \
    --to=pedro@palves.net \
    --cc=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).