Posts Tagged stackalloc

IL2CPP Output for C# 7.3: Local functions, fixed, and stackalloc

Tags: , , , ,

Continuing the series, today we’ll dive into local functions, fixed-size buffers, fixed blocks on arbitrary types with GetPinnableReference, and stackalloc initializers to see how they’re all implemented in C++ and what assembly code ends up actually running on the CPU.

Read the rest of this article »

2 Comments

IL2CPP Output for Unsafe Code

Tags: , , , ,

C# has some powerful features like fixed-size buffers, pointers, and unmanaged local variable arrays courtesy of stackalloc. These are deemed “unsafe” since they all deal with unmanaged memory. We should know what we’re ultimately instructing the CPU to execute when we use these features, so today we’ll take a look at the C++ output from IL2CPP and the assembly output from the C++ compiler to find out just that.

Read the rest of this article »

6 Comments

From AS3 to C#, Part 21: Unsafe Code

Tags: , , , ,

The series is nearing an end! In today’s article we’ll cover so-called “unsafe” code that gives you unprecedented access to system memory. You can use this to optimize your app or integrate with native (e.g. C, C++) code and APIs. Read on to learn more about this powerful C# tool!

Read the rest of this article »

4 Comments