Skip to content

Commit e1c3b34

Browse files
authored
specialize cconvert instead of unsafe_convert (#51)
JuliaLang/julia#51962 (comment) > It is generally best to implement cconvert (since it is not unsafe), > and generally required to call both functions as well (mimicking the > behavior defined for ccall)
1 parent c102065 commit e1c3b34

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/FixedSizeArrays.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ end
189189

190190
# unsafe: the native address of the array's storage
191191

192-
Base.unsafe_convert(::Type{Ptr{T}}, a::FixedSizeArray{T}) where {T} = Base.unsafe_convert(Ptr{T}, a.mem)
192+
Base.cconvert(::Type{<:Ptr}, a::FixedSizeArray) = a.mem
193193

194194
# `elsize`: part of the strided arrays interface, used for `pointer`
195195

0 commit comments

Comments
 (0)