You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-17 14:11:06 +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:
committed by
Raul Santos
parent
a05aefb74b
commit
b775573a21
@@ -278,7 +278,7 @@ bool GDMonoClass::has_public_parameterless_ctor() {
|
||||
return ctor && ctor->get_visibility() == IMonoClassMember::PUBLIC;
|
||||
}
|
||||
|
||||
GDMonoMethod *GDMonoClass::get_method(const StringName &p_name, int p_params_count) {
|
||||
GDMonoMethod *GDMonoClass::get_method(const StringName &p_name, uint16_t p_params_count) {
|
||||
MethodKey key = MethodKey(p_name, p_params_count);
|
||||
|
||||
GDMonoMethod **match = methods.getptr(key);
|
||||
@@ -316,7 +316,7 @@ GDMonoMethod *GDMonoClass::get_method(MonoMethod *p_raw_method, const StringName
|
||||
return get_method(p_raw_method, p_name, params_count);
|
||||
}
|
||||
|
||||
GDMonoMethod *GDMonoClass::get_method(MonoMethod *p_raw_method, const StringName &p_name, int p_params_count) {
|
||||
GDMonoMethod *GDMonoClass::get_method(MonoMethod *p_raw_method, const StringName &p_name, uint16_t p_params_count) {
|
||||
ERR_FAIL_NULL_V(p_raw_method, NULL);
|
||||
|
||||
MethodKey key = MethodKey(p_name, p_params_count);
|
||||
|
||||
Reference in New Issue
Block a user