I’m glad the foreach allocation problem was fixed, we still have the boxing problem with enums as generic argument. But I saw a new funny allocation bug on reddit
They point to the problem in the mono code, this is how mono 2 converts from float to decimal
Decimal d = Decimal.Parse (value.ToString (CultureInfo.InvariantCulture),
NumberStyles.Float, CultureInfo.InvariantCulture);
When was the foreach allocation problem fixed, out of curiosity? I’ve entirely eliminated its usage in lieu of for loops, and I’d be interested in knowing when I can start using them again, assuming I’ve got the right patch or version.
It’s odd that they choose decimal when your average operating system calculator just uses a double. That said if I had to track values greater than what double could handle I believe I’d choose a big math library before I choose decimal.
I think it was in currency calculator, let me see if I can find the reddit again. Anyway, on the .NET version strings are not used to convert floats to decimals…
Just spent some time digging around in code and discovered that Mono has been using Microsoft’s implementation for a couple years now. Switching their project to .NET 4.6 in Unity would likely eliminate the garbage altogether.