Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/strings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ struct PointerString <: AbstractString
len::Int
end

function Base.hash(s::PointerString, h::UInt)
h += Base.memhash_seed
ccall(Base.memhash, UInt, (Ptr{UInt8}, Csize_t, UInt32), s.ptr, s.len, h % UInt32) + h
if isdefined(Base, :memhash)
function Base.hash(s::PointerString, h::UInt)
h += Base.memhash_seed
ccall(Base.memhash, UInt, (Ptr{UInt8}, Csize_t, UInt32), s.ptr, s.len, h % UInt32) + h
end
end

import Base: ==
Expand Down