Introduce py-ref.h
authorTom Tromey <tom@tromey.com>
Sat, 5 Nov 2016 19:43:23 +0000 (13:43 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 11 Jan 2017 02:13:29 +0000 (19:13 -0700)
commita68ff33e0dcb4733584265088030d12a31e740e4
tree5523d403f4d3fb6ea32b673fa3f60c3d56d15e70
parent0b67023188fef926357f0fd27e600195ab35727e
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.
gdb/ChangeLog
gdb/python/py-ref.h [new file with mode: 0644]
This page took 0.025263 seconds and 4 git commands to generate.