julia
julia copied to clipboard
Feature request: API to get the `Memory` underlying an `Array`
This can currently be accessed using parent(my_vec.ref), but this is internal.
This is useful if one has a Vector, and needs acces to the lower-level, unresizable data backing it.
I believe this should be added as a method of parent: parent(a::Array) = a.ref.mem?
What works currently is obtaining the ref using cconvert and then fetching its parent.
julia> A = zeros(2);
julia> parent(Base.cconvert(Ptr, A))
2-element Memory{Float64}:
0.0
0.0