@@ -793,7 +793,7 @@ extension Unsafe${Mutable}RawBufferPointer {
793
793
}
794
794
795
795
_debugPrecondition (
796
- Int ( bitPattern: base) % MemoryLayout< S . Element> . stride == 0 ,
796
+ Int ( bitPattern: base) & MemoryLayout < S . Element > . alignment - 1 == 0 ,
797
797
" buffer base address must be properly aligned to access S.Element "
798
798
)
799
799
@@ -853,7 +853,7 @@ extension Unsafe${Mutable}RawBufferPointer {
853
853
return . init( start: nil , count: 0 )
854
854
}
855
855
_debugPrecondition (
856
- Int ( bitPattern: baseAddress) % MemoryLayout< C . Element> . stride == 0 ,
856
+ Int ( bitPattern: baseAddress) & MemoryLayout < C . Element > . alignment - 1 == 0 ,
857
857
" buffer base address must be properly aligned to access C.Element "
858
858
)
859
859
_precondition (
@@ -878,7 +878,7 @@ extension Unsafe${Mutable}RawBufferPointer {
878
878
}
879
879
_internalInvariant ( _end != nil )
880
880
_debugPrecondition (
881
- Int ( bitPattern: baseAddress) % MemoryLayout< C . Element> . stride == 0 ,
881
+ Int ( bitPattern: baseAddress) & MemoryLayout < C . Element > . alignment - 1 == 0 ,
882
882
" buffer base address must be properly aligned to access C.Element "
883
883
)
884
884
var iterator = source. makeIterator ( )
@@ -940,7 +940,7 @@ extension Unsafe${Mutable}RawBufferPointer {
940
940
return . init( start: nil , count: 0 )
941
941
}
942
942
_debugPrecondition (
943
- Int ( bitPattern: baseAddress) % MemoryLayout< T> . stride == 0 ,
943
+ Int ( bitPattern: baseAddress) & MemoryLayout < T > . alignment - 1 == 0 ,
944
944
" buffer base address must be properly aligned to access T "
945
945
)
946
946
_precondition (
0 commit comments