Skip to content

Commit

Permalink
use deplane_slow for x64 mac or windows
Browse files Browse the repository at this point in the history
  • Loading branch information
chrstphrbrns authored and tlnagy committed Jan 19, 2024
1 parent 09fe3e0 commit 66a0070
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ifds.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 66a0070

Please sign in to comment.