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] Don't steal references in the gdb Python code


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

Tom> Some Python APIs steal references from their caller, and the refcount
Tom> checker supports this via an attribute.

Tom> However, in gdb with C++ we have a better idiom available: we can use
Tom> std::move on a gdbpy_ref<> instead.  This makes the semantics obvious
Tom> at the point of call, and is safer at runtime as well, because the
Tom> callee's gdbpy_ref<> will be emptied.

Tom> This patch changes the reference-stealing code in gdb to use rvalue
Tom> references instead.

I got email from Simon saying this looked good, so I pushed it in.  But,
I don't see that email in the archives.  It was CC'd though.

Tom


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