This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Remove free_memory_read_result_vector
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Thu, 28 Sep 2017 16:41:19 +0100
- Subject: Re: [RFA] Remove free_memory_read_result_vector
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 41A5E10215C
- References: <20170924021159.21353-1-tom@tromey.com>
On 09/24/2017 03:11 AM, Tom Tromey wrote:
> This changes read_memory_robust to return a std::vector, allowing the
> removal of free_memory_read_result_vector and associated cleanups.
> This patch also changes the functions it touches to be a bit more
> robust with regards to deallocation; it's perhaps possible that
> read_memory_robust could have leaked in some situations.
>
> This patch is based on my earlier series to remove some MI cleanups.
> Regression tested by the buildbot.
>
Looks fine to me, with one nit:
> -extern void free_memory_read_result_vector (void *);
> + ~memory_read_result () = default;
> +
> + memory_read_result (memory_read_result &&other)
I think this can this be:
memory_read_result (memory_read_result &&other) = default;
(Which ends up being automatically noexcept if possible too.)
> + : begin (other.begin),
> + end (other.end),
> + data (std::move (other.data))
> + {
> + }
> +
Thanks,
Pedro Alves