Is passing by ref or passing by pointer faster?

I have some code that interop's with a C library. I'm already having to use unsafe in the code. If I have an interop function void foo(int* val); is it faster in the managed code to call foo(ref val); or foo(&val);? This function is going to be called at a fairly fast rate on an arm system running mono, so the faster the better.

by ThadeeusMaximus via /r/csharp

Leave a Reply