Skip to content

Commit

Permalink
specialize cconvert instead of unsafe_convert (#51)
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
nsajko authored May 2, 2024
1 parent c102065 commit e1c3b34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FixedSizeArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ end

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

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

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

Expand Down

0 comments on commit e1c3b34

Please sign in to comment.