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: [RFA] Use gdb::ref_ptr for values


On 11/03/2017 05:30 PM, Tom Tromey wrote:
> A while back I introduced gdb_value_up, a unique_ptr specialization
> for struct value.
> 
> However, I think this is incorrect -- values are reference counted
> (albeit in a somewhat strange way), and so it's better to use a
> gdb::ref_ptr specialization.
> 
> This patch makes this change.  There was only one use of gdb_value_up.
> 
> Regression tested on the buildbot.
> 
> gdb/ChangeLog
> 2017-11-03  Tom Tromey  <tom@tromey.com>
> 
> 	* value.h (struct value_ref_policy): Rename from value_deleter.
> 	Change to be gdb::ref_ptr policy class.
> 	(gdb_value_ref): Rename from gdb_value_up.  Use gdb::ref_ptr., 2017

Looks like a spurious ", 2017" managed to get here.

> 	* dwarf2loc.c (dwarf2_evaluate_loc_desc_full): Use gdb_value_ref.

Seems fine to me.

(IWBN to s/value_free/value_decref/g throughout, I think.)

Thanks,
Pedro Alves


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