I didn't know about that one so far! The "ref" modifier will tell the compiler that struct instances may only be allocated on the stack, preventing them from being used in heap-allocated locations. Cool! It couldn't be easier to write allocation free-code 🙌
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/ref-struct
#gamedev #unity3d #unitydev #dotnet #devtips #stackthatheap