Using the 'new' operator in C# means you're allocating managed memory. Which means, everytime you want to write to it using pointer logic, you have to fix it down. Fixing it down means your forcibly preventing the GC from moving the data to some other location in the memory.Quote:
What would the benefit be using AllocHGlobal instead of just "new byte[1024]"? They both allocate memory on the heap, but with AllocHGlobal you have to manually deallocate the memory when you're done using it.
Moral of the story, constantly/repetitively fixing down an array is expensive in contrast to doing it once (or not at all).