I noticed that taking views of non-"fast linear indexed" subarray allocates, while this is possible on classical vectors. Any idea, how to make this allocation free?
Here is an illustration of the behavior:
function temp!(lin::Vector{Int}, v::AbstractVector)
w = view(v, lin)
return nothing
end
lin = Int[1]; v = [0.0, 0.0, 0.0, 0.0];
temp!(lin, v)
@allocated temp!(lin, v) # allocates 0
vr = view(v, 1:3)
temp!(lin, vr)
@allocated temp!(lin, vr) # allocates 64