diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9641379..dae090d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,18 +15,14 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - julia-version: ["1.8", "1.10", nightly] + julia-version: ["1.8", "1.11", nightly] julia-arch: [x64, x86, aarch64] - os: [ubuntu-latest, windows-latest, macos-13, macos-latest] + os: [ubuntu-latest, windows-latest, macos-latest] exclude: - os: ubuntu-latest julia-arch: aarch64 - os: windows-latest julia-arch: aarch64 - - os: macos-13 - julia-arch: x86 - - os: macos-13 - julia-arch: aarch64 - os: macos-latest julia-arch: x86 - os: macos-latest diff --git a/.gitignore b/.gitignore index 48c374b..5e3b991 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ actual/ /deps/aes-ni Manifest.toml .DS_Store +.vscode/settings.json diff --git a/src/arm/aesni_common.jl b/src/arm/aesni_common.jl index 956594c..9a978fa 100644 --- a/src/arm/aesni_common.jl +++ b/src/arm/aesni_common.jl @@ -16,9 +16,9 @@ const LITTLE_ENDIAN::Bool = ENDIAN_BOM ≡ 0x04030201 abstract type ArmVec128 end @inline Base.convert(::Type{T}, x::ArmVec128) where {T<:Union{ArmVec128, UInt128}} = - unsafe_load(Ptr{T}(pointer_from_objref(Ref(x)))) + GC.@preserve x unsafe_load(Ptr{T}(pointer_from_objref(Ref(x)))) @inline Base.convert(::Type{T}, x::UInt128) where {T<:ArmVec128} = - unsafe_load(Ptr{T}(pointer_from_objref(Ref(x)))) + GC.@preserve x unsafe_load(Ptr{T}(pointer_from_objref(Ref(x)))) @inline Base.UInt128(x::ArmVec128) = convert(UInt128, x) @inline (::Type{T})(x::Union{ArmVec128, UInt128}) where {T<:ArmVec128} = convert(T, x) @inline Base.convert(::Type{T}, x::Union{Signed, Unsigned}) where {T<:ArmVec128} = diff --git a/src/common.jl b/src/common.jl index 7527411..9279717 100644 --- a/src/common.jl +++ b/src/common.jl @@ -15,7 +15,7 @@ abstract type R123Generator2x{T} <: AbstractR123{T} end "RNG that generates four numbers at a time." abstract type R123Generator4x{T} <: AbstractR123{T} end -_value(r::AbstractR123{T}, i = 1, ::Type{T2} = T) where {T, T2} = unsafe_load(Ptr{T2}(pointer_from_objref(r)), i) +_value(r::AbstractR123{T}, i = 1, ::Type{T2} = T) where {T, T2} = GC.@preserve r unsafe_load(Ptr{T2}(pointer_from_objref(r)), i) "Set the counter of a Random123 RNG." @inline function set_counter!(r::R123Generator1x{T}, ctr::Integer) where T <: UInt128 diff --git a/src/x86/aesni_common.jl b/src/x86/aesni_common.jl index 8a20c3b..cbaf422 100644 --- a/src/x86/aesni_common.jl +++ b/src/x86/aesni_common.jl @@ -8,8 +8,8 @@ const __m128i_lvec = NTuple{2, VecElement{UInt64}} struct __m128i data::__m128i_lvec end -Base.convert(::Type{__m128i}, x::UInt128) = unsafe_load(Ptr{__m128i}(pointer_from_objref(Ref(x)))) -Base.convert(::Type{UInt128}, x::__m128i) = unsafe_load(Ptr{UInt128}(pointer_from_objref(Ref(x)))) +Base.convert(::Type{__m128i}, x::UInt128) = GC.@preserve x unsafe_load(Ptr{__m128i}(pointer_from_objref(Ref(x)))) +Base.convert(::Type{UInt128}, x::__m128i) = GC.@preserve x unsafe_load(Ptr{UInt128}(pointer_from_objref(Ref(x)))) Base.UInt128(x::__m128i) = convert(UInt128, x) __m128i(x::UInt128) = convert(__m128i, x) Base.convert(::Type{__m128i}, x::Union{Signed, Unsigned}) = convert(__m128i, UInt128(x))