GDNative: passing in Godot types by reference?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By crotron

I currently have some code in C++ that I’m bringing into Godot through GDNative:

Array fft(Array values){
    //lots of computation
}

The function works as I expect it to. One thing that I’m thinking about, though, is whether I’m needlessly copying the contents of ‘values’ when I call this function, and if so, whether I can pass the Array by reference somehow. I played around with converting the argument of my function from ‘Array’ to ‘const Array&’, but I couldn’t get anything that worked.