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.
This commit is contained in:
parent
e75095e6c5
commit
71cd6a38fe
24 changed files with 80 additions and 20 deletions
|
|
@ -32,6 +32,8 @@ public class director_pass_by_value_runme {
|
|||
break;
|
||||
};
|
||||
}
|
||||
if (director_pass_by_value.has_cplusplus11())
|
||||
Counter.check_counts(1, 0, 0, 1, 0, 1); // check move constructor called and just one destructor
|
||||
// bug was the passByVal 'global' object was destroyed after the call to virtualMethod had finished.
|
||||
int ret = director_pass_by_value_runme.passByVal.getVal();
|
||||
if (ret != 0x12345678)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue