This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA 00/14] add a smart pointer for PyObject*
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
> gdbpy_reference sort_func = module.GetAttrString
> ("execute_frame_filters");
Pedro> I think that theory is incorrect. If module.GetAttrString() returns a
Pedro> gdbpy_reference, then RVO kicks in and no copy is made at all.
What happened is that I misread your example as just changing an
initializer to an assignment -- not seeing that in fact the first one
was also positing that the function would be returning a
gdbpy_reference. Which I should have realized since you explicitly said
that somewhere...
Pedro> There's another safety advantage to having functions return
Pedro> gdbpy_references directly.
I completely agree.
Tom