-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.x] Don't box params on Native->C# calls with Variant params #53942
Conversation
bool attrs_fetched; | ||
MonoCustomAttrInfo *attributes; | ||
bool attrs_fetched = false; | ||
MonoCustomAttrInfo *attributes = NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What C++ version are we using in 3.x? Is this allowed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are right, this C++ feature is not used in 3.x so I undid these changes.
Since 3.4 is late in beta, I'll let @akien-mga decide whether he prefers to leave this for 3.4.1/3.5. It's not a breaking change but it risks introducing bugs. |
Let's play it safe and wait for 3.5 then. |
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.
Thanks! |
Backport of #44106 and #53975 to
3.x
.Also includes some changes from #37050 since they were intertwined.