This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v2 22/22] Introduce and use bcache_up
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tom at tromey dot com>, gdb-patches at sourceware dot org
- Date: Wed, 6 Mar 2019 22:03:45 +0000
- Subject: Re: [PATCH v2 22/22] Introduce and use bcache_up
- References: <20190227201849.32210-1-tom@tromey.com> <20190227201849.32210-23-tom@tromey.com>
On 02/27/2019 08:18 PM, Tom Tromey wrote:
> This introduces a new bcache_up typedef, which is a unique_ptr
> specialization for managing a bcache. Then, this changes various
> spots to use this object, rather than manually calling bcache_xfree.
> This lets us remove a try/catch that only existed to call
> bcache_xfree.
I won't object, but is seems to me that it'd be better to
make bcache_xmalloc / bcache_free ctors/dtors of struct bcache,
and then we'd allocate a bcache object on the stack (and likewise
hold bcache objects in structures instead of bcache pointers).
Thanks,
Pedro Alves