diff options
author | Matthew Craven <5086-clyring@users.noreply.gitlab.haskell.org> | 2023-02-21 12:59:50 -0500 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-04-04 01:04:10 -0400 |
commit | 9095e297fbb46781fd182210609ce2a3f6c59b7a (patch) | |
tree | 98585355e6e01e02465c25d2febfd276adafccfd /libraries/base/Data | |
parent | 220a7a48cabdcfd2ef7bf5dbe3fd6df99e8d3c5b (diff) | |
download | haskell-9095e297fbb46781fd182210609ce2a3f6c59b7a.tar.gz |
Add a few more memcpy-ish primops
* copyMutableByteArrayNonOverlapping#
* copyAddrToAddr#
* copyAddrToAddrNonOverlapping#
* setAddrRange#
The implementations of copyBytes, moveBytes, and fillBytes
in base:Foreign.Marshal.Utils now use these new primops,
which can cause us to work a bit harder generating code for them,
resulting in the metric increase in T21839c observed by CI on
some architectures. But in exchange, we get better code!
Metric Increase:
T21839c
Diffstat (limited to 'libraries/base/Data')
-rw-r--r-- | libraries/base/Data/Array/Byte.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libraries/base/Data/Array/Byte.hs b/libraries/base/Data/Array/Byte.hs index 918e20bae8..99a7b0a36e 100644 --- a/libraries/base/Data/Array/Byte.hs +++ b/libraries/base/Data/Array/Byte.hs @@ -134,7 +134,7 @@ unsafeCopyByteArray (MutableByteArray dst#) (I# doff#) (ByteArray src#) (I# soff -- | Copy a slice from one mutable byte array to another -- or to the same mutable byte array. -- --- /Note:/ this function does not do bounds checking. +-- /Note:/ this function does not do bounds or overlap checking. unsafeCopyMutableByteArray :: MutableByteArray s -- ^ destination array -> Int -- ^ offset into destination array @@ -144,7 +144,7 @@ unsafeCopyMutableByteArray -> ST s () {-# INLINE unsafeCopyMutableByteArray #-} unsafeCopyMutableByteArray (MutableByteArray dst#) (I# doff#) (MutableByteArray src#) (I# soff#) (I# sz#) = - ST (\s# -> case copyMutableByteArray# src# soff# dst# doff# sz# s# of + ST (\s# -> case copyMutableByteArrayNonOverlapping# src# soff# dst# doff# sz# s# of s'# -> (# s'#, () #)) -- | @since 4.17.0.0 |