public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH] Use std::vector in event-loop.cc
Date: Mon, 8 Apr 2024 00:32:36 -0400	[thread overview]
Message-ID: <6bd26367-f926-4173-9c0d-032a724d7d7e@simark.ca> (raw)
In-Reply-To: <20240406183907.451889-1-tom@tromey.com>



On 2024-04-06 14:39, Tom Tromey wrote:
> In my occasional and continuing campaign against realloc, this patch
> changes event-loop.cc to use std::vector to keep track of pollfd
> objects.  Regression tested on x86-64 Fedora 38.

This LGTM.

Approved-By: Simon Marchi <simon.marchi@efficios.com>

I almost commented to say that the `num_fds` could be removed, that you
could use the vector size instead.  But then I saw that num_fds is also
used as the max fd number when using select.  I then saw that I had an
old draft patch that would remove the select code in event-loop.cc and
elsewhere.  The problem is that I don't remember the rationale for
starting such a patch.  Probably that all platforms we support have
something better than select for event handling, but I don't know for
sure.  But it would certainly help clean things up if we could remove
the select support.

Simon

  reply	other threads:[~2024-04-08  4:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-06 18:39 Tom Tromey
2024-04-08  4:32 ` Simon Marchi [this message]
2024-04-09 18:40 ` John Baldwin

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=6bd26367-f926-4173-9c0d-032a724d7d7e@simark.ca \
    --to=simark@simark.ca \
    --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).