Quote Originally Posted by DeepT
Out of curiosity, what kind of C# application needs a block of memory in a fixed location? Even when considering IPC, you share memory blocks via system objects, not actual memory addresses.
A C# application that needs to call a native Windows function. If that function needs a buffer to read from, if you don't pin the memory, the garbage collector might move it and the native function trying to read it will fail.

A fixed statment works but I, personally, prefer not using unsafe code. Using a GCHandle is the managed way of doing it