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 {
13101310 /// - offset: The offset from this pointer, in bytes. `offset` must be
13111311 /// nonnegative. The default is zero.
13121312 /// - 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
13131327 @inlinable
13141328 @_alwaysEmitIntoClient
13151329 // 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