File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1310,6 +1310,20 @@ public struct UnsafeMutableRawPointer: _Pointer {
1310
1310
/// - offset: The offset from this pointer, in bytes. `offset` must be
1311
1311
/// nonnegative. The default is zero.
1312
1312
/// - type: The type of `value`.
1313
+ #if $BitwiseCopyable
1314
+ @inlinable
1315
+ @_alwaysEmitIntoClient
1316
+ public func storeBytes< T : _BitwiseCopyable > (
1317
+ of value: T , toByteOffset offset: Int = 0 , as type: T . Type
1318
+ ) {
1319
+ withUnsafePointer ( to: value) { source in
1320
+ _memcpy (
1321
+ dest: ( self + offset) ,
1322
+ src: source,
1323
+ size: UInt ( MemoryLayout< T> . size) )
1324
+ }
1325
+ }
1326
+ #endif
1313
1327
@inlinable
1314
1328
@_alwaysEmitIntoClient
1315
1329
// This custom silgen name is chosen to not interfere with the old ABI
You can’t perform that action at this time.
0 commit comments