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/typemaps | |
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/typemaps')
-rw-r--r-- | Lib/typemaps/swigtype.swg | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/typemaps/swigtype.swg b/Lib/typemaps/swigtype.swg index 6973e3a10..52fac3252 100644 --- a/Lib/typemaps/swigtype.swg +++ b/Lib/typemaps/swigtype.swg @@ -417,7 +417,7 @@ /* directorin */ %typemap(directorin,noblock=1) SWIGTYPE { - $input = SWIG_NewPointerObj(%as_voidptr(new $1_ltype((const $1_ltype &)$1)), $&descriptor, SWIG_POINTER_OWN | %newpointer_flags); + $input = SWIG_NewPointerObj(%as_voidptr(new $1_ltype(SWIG_STD_MOVE($1))), $&descriptor, SWIG_POINTER_OWN | %newpointer_flags); } %typemap(directorin,noblock=1) SWIGTYPE * { |