From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 2UB4BRWcF2kPhQIAWB0awg (envelope-from ) for ; Fri, 14 Nov 2025 16:16:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1763154965; bh=SddVzFScrsyOfFLGzv35zg27cq1gc6WRBeV31xFLVjQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=nTfsri4gCM+sHnciePp2VEeSyO01SnPWhCD5MjzbO5K1niWr0epJ2+/OdiNOAQeWG SQFLmfkD7mxedXN4Y1WvCrJe4riiaK6QEXQiksNC+YeFj7AzMiMFMcdcJ5oX4v7Tm8 qxPOhbEEfgLrGOUxAswPpshH4XKHE7f5zdnGtj9U= Received: by simark.ca (Postfix, from userid 112) id 113F31E0B8; Fri, 14 Nov 2025 16:16:05 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=QReRSGhC; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id AF2161E04C for ; Fri, 14 Nov 2025 16:16:00 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5DB7A3858CD1 for ; Fri, 14 Nov 2025 21:16:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5DB7A3858CD1 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=QReRSGhC Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 859193858D1E for ; Fri, 14 Nov 2025 21:15:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 859193858D1E 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 859193858D1E 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=1763154927; cv=none; b=YsdIVpBNGd8/yP0dzB0WfwQdM48zg48sM1n+BQavkh6ATlLRvTTGE+eEz8ZbcTCo3/ydc1xsW8e7oAFV8Q0k4FbG4ep6ZyUHTa2Lxq4lzmbERosMq9lINNtnkPR/VHMiU0ApX5w2w2q8c5V/NNtOX2n4r5DEQ6LzVHGbPCyZQrE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1763154927; c=relaxed/simple; bh=SddVzFScrsyOfFLGzv35zg27cq1gc6WRBeV31xFLVjQ=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=NvgMcRr0QFOYyvNjt5apw8EaY/nRnUO4qhnU6ke8vrgTvXaq+4MP2RxeUJxP6oHZuxiugf+foQqum1lqeBxw0UaM4SErTy0O2HpPdXW5tH/C7wnb6z+UYv2vucQjrCYFXyir4P/c8kOXwdBZk0WzGG2mP6RIYhHHRxdRBf8fuy0= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 859193858D1E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1763154927; bh=SddVzFScrsyOfFLGzv35zg27cq1gc6WRBeV31xFLVjQ=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=QReRSGhCbqjVsYcVg5hUj5qpLEjcrQ4hT9HylY+V92A4SaTEPuGBYLriB0vu4iaNH Xb4iOwD3OYNy6jTg6N5Lo6UzwXj8IAs2Sr7XZeqs4XQcYVXKl5V8VWg0HSlg+vwxwR aSicEWEzluECj+GvX1JQf9VVRjcuCZpMVnVsxnnc= Received: by simark.ca (Postfix) id 022301E04C; Fri, 14 Nov 2025 16:15:26 -0500 (EST) Message-ID: Date: Fri, 14 Nov 2025 16:15:26 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] gdb: use gdb::unordered_{set,map} at a few places To: Tom Tromey , Simon Marchi Cc: gdb-patches@sourceware.org References: <20251113213506.313040-1-simon.marchi@efficios.com> <20251113214507.359286-1-simon.marchi@efficios.com> <87a50ov1gv.fsf@tromey.com> <87wm3stm63.fsf@tromey.com> <87o6p4tj55.fsf@tromey.com> Content-Language: en-US From: Simon Marchi In-Reply-To: <87o6p4tj55.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 2025-11-14 16:10, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > >>> The move operators are fine, this particular part of the note is just >>> saying that perhaps proc_mem_file would benefit from the explicit >>> addition of DISABLE_COPY_AND_ASSIGN. However it's not truly needed. > > Simon> Ok, I have no problem being more explicit than necessary and using > Simon> DISABLE_COPY_AND_ASSIGN there. See updated patch below. > > Simon> struct refcnt_fd > Simon> { > Simon> - DISABLE_COPY_AND_ASSIGN (refcnt_fd); > Simon> refcnt_fd (int fd, int refcnt) : fd (fd), refcnt (refcnt) {} > > I still think this removal is in error. Is it really needed? > Allowing copying here would surely lead to bugs. Well, since I defaulted the move operations, the copy operations are disabled (at least that is my understanding). But again, I can be more explicit than needed, since it's clearer. I think it's a bit odd to prevent copying this particular structure in the first place, since it's not that structure that controls the release of the resource, through its constructor. It's done externally. Simon