Examples of memory aliasing

Hello,

I was reading the definition of AbstractArray in Base and I was searching for concrete cases of memory aliasing with two AbstractArrays.

A simple case with SubArrays.

julia> A=randn(10)

julia> Base.mightalias(A,view(A,1:5))
true

Do you know other examples in Base without using SubArrays ?

Two examples that come to mind are reshaping and transposing:

julia> A = rand(3, 3);

julia> Base.mightalias(A, vec(A))
true

julia> Base.mightalias(A, reshape(A, :))
true

julia> Base.mightalias(A, transpose(A))
true

Nice ! I forgot that reshaping was actually not allocating a new chunk of memory !