[PATCH] Reduce manual reference counting in py-inferior.c
Tom Tromey
tromey@adacore.com
Wed Jul 10 18:24:00 GMT 2019
>>>>> "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
More information about the Gdb-patches
mailing list