@@ -482,7 +482,8 @@ function read_remainder!(copies::Vector{UInt8}, copies_offset::UInt64, from::Den
482482 elsize = sizeof (eltype (from))
483483 from_offset = UInt64 ((from_ptr - UInt64 (pointer (from))) / elsize) + UInt64 (1 )
484484 from_vec = reshape (from, prod (size (from))):: DenseVector{eltype(from)}
485- copyto! (copies, Int (copies_offset), from_vec, Int (from_offset), Int (n))
485+ copies_typed = unsafe_wrap (Vector{eltype (from)}, Ptr {eltype(from)} (pointer (copies, copies_offset)), n)
486+ copyto! (copies_typed, 1 , from_vec, Int (from_offset), Int (n))
486487end
487488function read_remainder! (copies:: Vector{UInt8} , copies_offset:: UInt64 , from:: SubArray , from_ptr:: UInt64 , n:: UInt64 )
488489 read_remainder! (copies, copies_offset, parent (from), from_ptr, n)
@@ -492,7 +493,8 @@ function write_remainder!(copies::Vector{UInt8}, copies_offset::UInt64, to::Dens
492493 elsize = sizeof (eltype (to))
493494 to_offset = UInt64 ((to_ptr - UInt64 (pointer (to))) / elsize) + UInt64 (1 )
494495 to_vec = reshape (to, prod (size (to))):: DenseVector{eltype(to)}
495- copyto! (to_vec, Int (to_offset), copies, Int (copies_offset), Int (n))
496+ copies_typed = unsafe_wrap (Vector{eltype (to)}, Ptr {eltype(to)} (pointer (copies, copies_offset)), n)
497+ copyto! (to_vec, Int (to_offset), copies_typed, 1 , Int (n))
496498end
497499function write_remainder! (copies:: Vector{UInt8} , copies_offset:: UInt64 , to:: SubArray , to_ptr:: UInt64 , n:: UInt64 )
498500 write_remainder! (copies, copies_offset, parent (to), to_ptr, n)
0 commit comments