Hi, I’m exploring the use of mmap and getting the error below when mmap is called
The line is:
countIndex = mmap(“tmp”, Matrix{UInt32}, (NUM_BIGRAMS,30); shared=false)
I’ve also tried a file handle as produced by ‘open’ instead of “tmp” and with/without the offset argument. Here’s the error:
ERROR: MethodError: no method matching unsafe_wrap(::Type{Array}, ::Ptr{UInt32}, ::Tuple{UInt32, Int64})
The function unsafe_wrap exists, but no method is defined for this combination of argument types.
Closest candidates are:
unsafe_wrap(::Union{Type{Array}, Type{Array{T}}, Type{Array{T, N}}}, ::Ptr{T}, ::NTuple{N, Int64}; own) where {T, N}
@ Base pointer.jl:108
unsafe_wrap(::Union{Type{Array}, Type{Array{T}}, Type{Vector{T}}}, ::Ptr{T}, ::Integer; own) where T
@ Base pointer.jl:113
unsafe_wrap(::Union{Type{Array}, Type{Array{T}}, Type{Array{T, N}}, Type{GenericMemory{kind, <:Any, Core.AddrSpace{Core}(0x00)}}, Type{GenericMemory{kind, T, Core.AddrSpace{Core}(0x00)}}} where kind, ::Ptr{T}, ::NTuple{N, var"#s123"} where var"#s123"<:Integer; own) where {T, N}
@ Base pointer.jl:129
…
Would anyone have any suggestions?
NUM_BIGRAMS doesn’t match 30 in type, but the dims for mmap requires a Tuple of the same type of integer, which the docs are vague about. Watch out that other functions often more strictly require dims with all Int.