StaticArrays as vector elements

I remember having seen somewhere an argument that stated that static vectors were stored sequentially (contiguously) in an array of such vectors. No pointers were stored, the data itself. Would anyone remember where to find this?

1 Like

Immutable isbits struct and tuple data are always stored inline in arrays.


While I don’t have a source for you, this is true of any struct that stores data for which isbits(data) == true, not just static arrays, and if you construct a static array where the eltype is not isbits, i.e. an abstract eltype, then it won’t be stored inline.

As of julia 1.4, struct with fields that are a union of isbits types will also be stored inline. The source this can be seen here: julia/ at v1.4.0 · JuliaLang/julia · GitHub