This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 22/22] Introduce and use bcache_up


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]