I have a large char[] buffer allocated in c# and want to pass a pointer to this data to an umnanaged c function in a DLL.
Now i think for this to work the char buffer must be FIXED so that GC cant shift it around while the function is working.
If so, would i declare the buffer FIXED and call the DLL within and UNSAFE block ??
fixed ( int* p = &bigbuffer )
{
processbigbuffer(bigbuffer);
}
I have searched but not many references highlight the issue that the memory belongs to c# and how this would work in a DLL.
Thanks