Are arrays contiguous in memory? And do they hold references or values?

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

I’m asking about the gdscript array specifically.

:bust_in_silhouette: Reply From: kidscancode

No, Godot Arrays are not contiguous in memory. If you need that for some reason, see the Pool*Array types.

Arrays hold Variants. Whether the contents are references or values depends on what types you added. For example, in Godot, Arrays, Dictionaries, and Resources are passed by reference. This is documented in the API docs for each particular type.