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] Reduce manual reference counting in py-inferior.c


>>>>> "Tom" == Tom Tromey <tromey@adacore.com> writes:

Tom> This patch changes py-inferior.c to use gdbpy_ref<> when possible,
Tom> reducing the amount of manual reference counting.

Tom> Tested on x86-64 Fedora 29.

Tom> gdb/ChangeLog
Tom> 2019-07-01  Tom Tromey  <tromey@adacore.com>

Tom> 	* python/python-internal.h (create_thread_object): Return
Tom> 	gdbpy_ref.
Tom> 	* python/py-infthread.c (create_thread_object): Return gdbpy_ref.
Tom> 	* python/py-inferior.c (struct threadlist_entry): Add
Tom> 	constructor.
Tom> 	<thread_obj>: Now a gdbpy_ref.
Tom> 	(thread_to_thread_object): Update.
Tom> 	(add_thread_object): Use new.
Tom> 	(delete_thread_object): Use delete.
Tom> 	(infpy_threads): Update.
Tom> 	(py_free_inferior): Update.  Construct "inf_obj" after acquiring
Tom> 	GIL.

I'm checking this in.

Tom


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