From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 697D13858D28 for ; Mon, 8 Apr 2024 04:32:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 697D13858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 697D13858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712550758; cv=none; b=vkMnXZZwOGJV2UjXPYQsn208mw2WFQFor43fGJexpR86cCYo/f7cYh/WggkhwGNpVhcO8X+/UX66H6Lfe2rkeRxOB90a6SopNEMANfLuNU1DLx0Kehn5oYPBS1lROO6sK+NGAdkYYAhA8YXvrVWOWy/uhIpvpTf+mdLKvCpcOlg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712550758; c=relaxed/simple; bh=YzCHNrDEO9KF2fs0mKEhzhaOcrvLYsfyGYP6xtbLnPY=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=buiTjOFHgHZ4teYMq9ZirKkdZNZddBQeF6x6NOhIU6bBSpMAeyQJ8HNiItvm4yy7AEGxuwhAhf8SiHL43meGS8bzxDf8IY3sIbg66l9SIchIDOAa0gfwm3gDwq37c5UTv/HM63j3DtGxCr001S2XMb/rFcEZbp/6RtypgH3ymw0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1712550756; bh=YzCHNrDEO9KF2fs0mKEhzhaOcrvLYsfyGYP6xtbLnPY=; h=Date:Subject:To:References:From:In-Reply-To:From; b=B/034/cSUABFXRpDXbJThtvSZa8F3nLOrWNfU67dCXkdSZ/YWgmDpxSCmWO9uxFtk Gb38XJE6wLplJqPw9eo0eeYYkyXJvLTG2/8qLMXs8UXjE4du3JWzHrxZPV0vogHXgl Y3UNdYNfOFeymhX45VBPhz1mfb9eq6Ot/ZcjgLnc= Received: from [10.0.0.11] (modemcable238.237-201-24.mc.videotron.ca [24.201.237.238]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id CB0C41E092; Mon, 8 Apr 2024 00:32:36 -0400 (EDT) Message-ID: <6bd26367-f926-4173-9c0d-032a724d7d7e@simark.ca> Date: Mon, 8 Apr 2024 00:32:36 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Use std::vector in event-loop.cc To: Tom Tromey , gdb-patches@sourceware.org References: <20240406183907.451889-1-tom@tromey.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <20240406183907.451889-1-tom@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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 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