From: Simon Marchi <simark@simark.ca>
To: Tom Tromey <tom@tromey.com>, Simon Marchi <simon.marchi@efficios.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH v2] gdb: use gdb::unordered_{set,map} at a few places
Date: Fri, 14 Nov 2025 16:15:26 -0500 [thread overview]
Message-ID: <d8c4798e-ec8f-40d2-b3a4-c9a70bb84dac@simark.ca> (raw)
In-Reply-To: <87o6p4tj55.fsf@tromey.com>
On 2025-11-14 16:10, Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> 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
next prev parent reply other threads:[~2025-11-14 21:16 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-13 21:35 [PATCH] " Simon Marchi
2025-11-13 21:43 ` [PATCH v2] " Simon Marchi
2025-11-14 19:49 ` Tom Tromey
2025-11-14 20:00 ` Simon Marchi
2025-11-14 20:05 ` Tom Tromey
2025-11-14 20:32 ` Simon Marchi
2025-11-14 21:10 ` Tom Tromey
2025-11-14 21:15 ` Simon Marchi [this message]
2025-11-14 21:43 ` Tom Tromey
2025-11-14 22:20 ` Simon Marchi
2025-11-17 15:58 ` Tom Tromey
2025-11-17 16:31 ` Simon Marchi
2026-07-27 16:21 ` Daniel Fellows
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=d8c4798e-ec8f-40d2-b3a4-c9a70bb84dac@simark.ca \
--to=simark@simark.ca \
--cc=gdb-patches@sourceware.org \
--cc=simon.marchi@efficios.com \
--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