@@ -781,7 +781,7 @@ extension Unsafe${Mutable}RawBufferPointer {
781
781
}
782
782
783
783
_debugPrecondition (
784
- Int ( bitPattern: base) % MemoryLayout< S . Element> . stride == 0 ,
784
+ Int ( bitPattern: base) & MemoryLayout < S . Element > . alignment - 1 == 0 ,
785
785
" buffer base address must be properly aligned to access S.Element "
786
786
)
787
787
@@ -841,7 +841,7 @@ extension Unsafe${Mutable}RawBufferPointer {
841
841
return . init( start: nil , count: 0 )
842
842
}
843
843
_debugPrecondition (
844
- Int ( bitPattern: baseAddress) % MemoryLayout< C . Element> . stride == 0 ,
844
+ Int ( bitPattern: baseAddress) & MemoryLayout < C . Element > . alignment - 1 == 0 ,
845
845
" buffer base address must be properly aligned to access C.Element "
846
846
)
847
847
_precondition (
@@ -866,7 +866,7 @@ extension Unsafe${Mutable}RawBufferPointer {
866
866
}
867
867
_internalInvariant ( _end != nil )
868
868
_debugPrecondition (
869
- Int ( bitPattern: baseAddress) % MemoryLayout< C . Element> . stride == 0 ,
869
+ Int ( bitPattern: baseAddress) & MemoryLayout < C . Element > . alignment - 1 == 0 ,
870
870
" buffer base address must be properly aligned to access C.Element "
871
871
)
872
872
var iterator = source. makeIterator ( )
@@ -928,7 +928,7 @@ extension Unsafe${Mutable}RawBufferPointer {
928
928
return . init( start: nil , count: 0 )
929
929
}
930
930
_debugPrecondition (
931
- Int ( bitPattern: baseAddress) % MemoryLayout< T> . stride == 0 ,
931
+ Int ( bitPattern: baseAddress) & MemoryLayout < T > . alignment - 1 == 0 ,
932
932
" buffer base address must be properly aligned to access T "
933
933
)
934
934
_precondition (
0 commit comments