From 66a0070a9f7638cced5c789c9aa89ed3d640190d Mon Sep 17 00:00:00 2001 From: Christopher Burns Date: Sat, 13 Jan 2024 06:00:16 -0600 Subject: [PATCH] use deplane_slow for x64 mac or windows --- src/ifds.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ifds.jl b/src/ifds.jl index 8d31122..9dad27f 100644 --- a/src/ifds.jl +++ b/src/ifds.jl @@ -446,13 +446,15 @@ function deplane!(arr::AbstractVector{T}, n::Integer) where T deplane!(out, arr, n) end +const is_mac_or_windows_x64 = (Sys.iswindows() || Sys.isapple()) && Sys.ARCH == :x86_64 + # {AAA...BBB...CCC...} => {ABCABCABC...} function deplane!(buffer::AbstractVector{T}, arr::AbstractVector{T}, n::Integer) where T @assert length(buffer) == length(arr) @assert length(arr) % n == 0 GC.@preserve arr buffer begin - if Int(pointer(arr)) & 0x3f > 0 || length(arr) < 64 + if Int(pointer(arr)) & 0x3f > 0 || length(arr) < 64 || is_mac_or_windows_x64 # small or not 64-byte aligned temp = deplane_slow(arr, n) GC.@preserve temp begin