Today we continue looking at the C++ that IL2CPP generates for our C# code by calling various types of functions and using boxing and unboxing. Just how much performance overhead do these entail? Read on to find out!
Posts Tagged unboxing
Value types like
int, structs, and enums seem simple, but much of what we think we know about them just isn’t true. This article explores how value types actually work in C# and uses that knowledge to improve how they’re implemented in the C++ scripting system.
The GitHub project is closing in on supporting all the “must have” features. Today’s article tackles “boxing” and “unboxing” so our C++ game code will be able to convert types like
int into an
object and then convert an
object back into an
int. Usually we want to avoid this because it creates garbage for the GC to later collect and ruins type safety, but sometimes an API like
Debug.Log insists that we pass it an
object. Read on to see how to use boxing and unboxing in C++!