mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
Don't box params on Native->C# calls with Variant params
Godot uses Variant parameters for calls to script methods. Up until now we were boxing such parameters when marshalling them for invokation, even if they were value types. Now Godot allocates the marshalled parameters on the stack, reducing the GC allocations resulted from boxing.
This commit is contained in:
parent
a05aefb74b
commit
b775573a21
12 changed files with 712 additions and 649 deletions
|
@ -2479,7 +2479,7 @@ bool CSharpScript::_get_signal(GDMonoClass *p_class, GDMonoClass *p_delegate, Ve
|
|||
|
||||
if (mono_type_get_type(raw_type) == MONO_TYPE_CLASS) {
|
||||
// Arguments are accessibles as arguments of .Invoke method
|
||||
GDMonoMethod *invoke = p_delegate->get_method("Invoke", -1);
|
||||
GDMonoMethod *invoke = p_delegate->get_method(mono_get_delegate_invoke(p_delegate->get_mono_ptr()));
|
||||
|
||||
Vector<StringName> names;
|
||||
Vector<ManagedType> types;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue