UdonHeap.SetHeapVariable triggers unnecessary memory allocations
bd_
When invoking UdonHeap.SetHeapVariable, in UdonHeap.SetHeapVariableInternal, a new StrongBox is constructed unconditionally, even if the StrongBox in the heap already has the correct type. This results in GC pressure whenever a cross-UdonBehaviour heap variable is set (which occurs whenever we perform a U# method call with parameters across behaviours).
This could be resolved by reusing the StrongBox, as in CopyHeapVariable.
Log In
bd_
Note that this method seems to be invoked on many extern invocations, which means it's a major source of GC pressure, even for functions which ostensibly return an unboxed value...