From 319d4f9b266dc03bd49bfd885a71a90b7f718493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Haraldsson?= Date: Wed, 13 Aug 2025 23:08:29 +0000 Subject: [PATCH 1/2] Fix for newer Julia - Update strings.jl --- src/strings.jl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/strings.jl b/src/strings.jl index bed60f3..40c553b 100644 --- a/src/strings.jl +++ b/src/strings.jl @@ -4,8 +4,12 @@ struct PointerString <: AbstractString 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 + @static if isdefined(Base, :hash_bytes) + GC.@preserve s.ptr Base.hash_bytes(s.ptr), s.len, UInt64(h), Base.HASH_SECRET) % UInt + else + h += Base.memhash_seed + ccall(Base.memhash, UInt, (Ptr{UInt8}, Csize_t, UInt32), s.ptr, s.len, h % UInt32) + h + end end import Base: == From 0278b9037978f5025f9b6e1eab0d53faa4b22f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1ll=20Haraldsson?= Date: Wed, 13 Aug 2025 23:29:42 +0000 Subject: [PATCH 2/2] Fix typo - Update strings.jl --- src/strings.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/strings.jl b/src/strings.jl index 40c553b..4cddbb7 100644 --- a/src/strings.jl +++ b/src/strings.jl @@ -5,7 +5,7 @@ end function Base.hash(s::PointerString, h::UInt) @static if isdefined(Base, :hash_bytes) - GC.@preserve s.ptr Base.hash_bytes(s.ptr), s.len, UInt64(h), Base.HASH_SECRET) % UInt + GC.@preserve s.ptr Base.hash_bytes(s.ptr, s.len, UInt64(h), Base.HASH_SECRET) % UInt else h += Base.memhash_seed ccall(Base.memhash, UInt, (Ptr{UInt8}, Csize_t, UInt32), s.ptr, s.len, h % UInt32) + h