diff options
author | William S Fulton <wsf@fultondesigns.co.uk> | 2022-07-03 13:58:26 +0100 |
---|---|---|
committer | William S Fulton <wsf@fultondesigns.co.uk> | 2022-07-04 11:19:29 +0100 |
commit | 71cd6a38fe539a89dc2ee159c6d54017fd4e90a0 (patch) | |
tree | 4f7ab68006694285eafcfd5775d940310093f007 /Lib/ruby | |
parent | e75095e6c56ac45aba7aaafb4c732e1f1c675591 (diff) | |
download | swig-71cd6a38fe539a89dc2ee159c6d54017fd4e90a0.tar.gz |
Performance optimisation for directors for classes passed by value
The directorin typemaps in the director methods now use std::move on the
input parameter when copying the object from the stack to the heap prior
to the callback into the target language, thereby taking advantage of
move semantics if available.
Diffstat (limited to 'Lib/ruby')
-rw-r--r-- | Lib/ruby/boost_shared_ptr.i | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/ruby/boost_shared_ptr.i b/Lib/ruby/boost_shared_ptr.i index 9676bf9d8..fe3ea8cde 100644 --- a/Lib/ruby/boost_shared_ptr.i +++ b/Lib/ruby/boost_shared_ptr.i @@ -59,7 +59,7 @@ } %typemap(directorin,noblock=1) CONST TYPE (SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE > *smartarg = 0) %{ - smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(($1_ltype &)$1)); + smartarg = new SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >(new $1_ltype(SWIG_STD_MOVE($1))); $input = SWIG_NewPointerObj(%as_voidptr(smartarg), $descriptor(SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > *), SWIG_POINTER_OWN | %newpointer_flags); %} %typemap(directorout,noblock=1) CONST TYPE (void *swig_argp, int swig_res = 0) { |