in reply to double array in XS

I'm afraid I don't know enough about XS to tell you whether there is a way to do it directly.

However, it's likely that the time required to copy the array is negligibile compared to the time required to execute the library call. Iterating over an array twice is not significantly worse than iterating over it once. (2X at worst, not taking into account the effects of the cache)

If, on the other hand, the c function is something like a binary search that doesn't iterate over the entire array, and the size of your array is large, then you may need to be concerned.