This is the mail archive of the gdb-testers@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]

[binutils-gdb] Introduce py-ref.h


*** TEST RESULTS FOR COMMIT a68ff33e0dcb4733584265088030d12a31e740e4 ***

Author: Tom Tromey <tom@tromey.com>
Branch: master
Commit: a68ff33e0dcb4733584265088030d12a31e740e4

Introduce py-ref.h

This patch introduces class gdbpy_ref, which is a sort of smart
pointer that owns a single Python reference to a PyObject.  This class
acts a bit like unique_ptr, but also a bit like shared_ptr (in that
copies do what you might expect); I considered going solely with
unique_ptr but it seemed quite strange to have a unique_ptr that
actually manages a shared resource.

Subsequent patches use this new class to simplify logic in the Python
layer.

2017-01-10  Tom Tromey  <tom@tromey.com>

	* python/py-ref.h: New file.


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