Several simple subtypes of AbstractVector that just wrap Memory or MemoryRef.
One of the main differences between these types and Memory is that the types defined in this package are supposed to never throw BoundsError. This is beneficial because throwing BoundsError escapes the AbstractArray value, making it impossible to eliminate the underlying allocation.
Comparison with FixedSizeArrays.jl: the two packages are very similar, here are some differences:
-
This package only supports
AbstractVector. This makes the types defined here cheaper, as there is no need to store theAbstractArrayshape. It also simplifies the implementation. -
This package supports some variations not supported by FixedSizeArrays.jl: a
MemoryRefmay be stored instead of directly storing aMemory. TODO: investigate whether this allows performance improvements. -
The type parameters are executed differently, leading to a simpler implementation.
In the future, it might make sense to extend FixedSizeArrays.jl so it would allow being based on the types defined here, instead of accepting only Memory as the parent type.