I've implemented a way of clearing locals in my own game awhile ago. Given that any structs passed into a function linger around until the function is recalled, where at that point locals are refreshed.
This PR aims to improve that by clearing locals at the very end, resolving #91.
I've taken the array_resize approach, as loops aren't anywhere near as fast as array_resize the more locals there is needed to be cleared. Looping is only really beneficial if the local count is very low, and on YYC. I also have moved localCount to the top of the function, as localCount is also used for resetting the locals array back to it's original size.
I've implemented a way of clearing locals in my own game awhile ago. Given that any structs passed into a function linger around until the function is recalled, where at that point locals are refreshed.
This PR aims to improve that by clearing locals at the very end, resolving #91. I've taken the
array_resize
approach, as loops aren't anywhere near as fast asarray_resize
the more locals there is needed to be cleared. Looping is only really beneficial if the local count is very low, and on YYC. I also have movedlocalCount
to the top of the function, aslocalCount
is also used for resetting the locals array back to it's original size.