In my C# code, I have constructed four arrays of data:
double[] values;
DateTime[] timestamps;
long[] qualities;
long[] reasons;
These arrays need to be passed to an external API. The API method call is somewhat indirect; its signature looks like invokeApiMethod(string apiMethodName, Object[] apiMethodParams).
In this case, the external API method call expects four arrays of the kind that I have already constructed.
If I construct the Object[] using the following code:
Object[] apiMethodParams = { values, timestamps, qualities, reasons };
Will this result in all four existing arrays being copied into a large contiguous block of new memory? Or will C# just pass an array of references to the existing arrays to the external API?