Closed Thomas008 closed 5 months ago
The problem is that MallocMatrix
is an incomplete type; you need to fully specify the type.
julia> MallocMatrix
MallocMatrix (alias for MallocArray{T, 2} where T)
julia> MallocVector{MallocMatrix}(undef,3)
ERROR: AssertionError: Base.allocatedinline(T)
Stacktrace:
[1] MallocArray
@ ~/.julia/packages/StaticTools/PMqff/src/mallocarray.jl:112 [inlined]
[2] MallocVector{MallocMatrix}(x::UndefInitializer, dims::Int64)
@ StaticTools ~/.julia/packages/StaticTools/PMqff/src/mallocarray.jl:131
[3] top-level scope
@ REPL[3]:1
julia> MallocVector{MallocMatrix{Float64}}(undef,3)
3-element MallocVector{MallocMatrix{Float64}}:
0×0 MallocMatrix{Float64}
0×0 MallocMatrix{Float64}
0×0 MallocMatrix{Float64}
Great! I understand. Thank you a lot!
I would like to use StaticTools to compile a MallocArray on MallocMatrix. StaticTools is very great e.g. to represent Strings in a MallocMatrix. When initializing a MallocArray on MallocMatrix, I get an AssertionError:
MallocVector{MallocMatrix}(undef,3)
Then I get
How can I initilize a MallocVector in MallocMatrix? There was already a similar issue. The solution was about redefining
Base.allocatedinline(T)
, orBase.unsafe_load
andBase.unsafe_store
(?)