Interfacing to GDNative through pointers?

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

I have a function in C++ that is called like this:

void function(int* arr1, float* arr2);

As I understand it, GDNative wants something that is called more like this:

void function(Array arr1, Array arr2);

I could manually modify my C++ code to take Array objects instead of pointers. Problem is, I’ll have to go through a ton of functions to make that change. Is there a way to avoid doing this? I know in some frameworks, you can get a pointer to the raw Array of the appropriate type so that working with things like int* isn’t an issue. Is it possible to do this in Godot?

As a side note, should I worry about the performance impact of passing an Array by value in GDNative?