I'm looking to use P/Invoke to allow my C# assembly to interop with a native C library; this needs to be cross-platform (i.e. Mono), so a mixed-mode assembly cannot be used. I'm wondering if there is any performance advantage to using unsafe P/invoke calls, and handling all the conversions to pointers in an unsafe method, versus making the typical "safe" P/Invoke call. Thanks in advance!
CLARIFICATION: I am not looking to use a managed C++ wrapper, as is discussed here. I just want to know if there are performance differences between:
extern static void native_call_here(IntPtr parameter1, String parameter2)
and
extern static void native_call_here(int* parameter1, char* parameter2)