[Git][ghc/ghc][master] Fix wording in primops documentation to reflect the correct reasoning:
Marge Bot
gitlab at gitlab.haskell.org
Thu May 21 16:21:12 UTC 2020
Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC
Commits:
1b508a9e by Alexey Kuleshevich at 2020-05-21T12:21:02-04:00
Fix wording in primops documentation to reflect the correct reasoning:
* Besides resizing functions, shrinking ones also mutate the
size of a mutable array and because of those two `sizeofMutabeByteArray`
and `sizeofSmallMutableArray` are now deprecated
* Change reference in documentation to the newer functions `getSizeof*`
instead of `sizeof*` for shrinking functions
* Fix incorrect mention of "byte" instead of "small"
- - - - -
1 changed file:
- compiler/GHC/Builtin/primops.txt.pp
Changes:
=====================================
compiler/GHC/Builtin/primops.txt.pp
=====================================
@@ -1254,7 +1254,7 @@ primop ShrinkSmallMutableArrayOp_Char "shrinkSmallMutableArray#" GenPrimOp
SmallMutableArray# s a -> Int# -> State# s -> State# s
{Shrink mutable array to new specified size, in
the specified state thread. The new size argument must be less than or
- equal to the current size as reported by {\tt sizeofSmallMutableArray\#}.}
+ equal to the current size as reported by {\tt getSizeofSmallMutableArray\#}.}
with out_of_line = True
has_side_effects = True
@@ -1279,8 +1279,8 @@ primop SizeofSmallArrayOp "sizeofSmallArray#" GenPrimOp
primop SizeofSmallMutableArrayOp "sizeofSmallMutableArray#" GenPrimOp
SmallMutableArray# s a -> Int#
{Return the number of elements in the array. Note that this is deprecated
- as it is unsafe in the presence of resize operations on the
- same byte array.}
+ as it is unsafe in the presence of shrink and resize operations on the
+ same small mutable array.}
with deprecated_msg = { Use 'getSizeofSmallMutableArray#' instead }
primop GetSizeofSmallMutableArrayOp "getSizeofSmallMutableArray#" GenPrimOp
@@ -1451,7 +1451,7 @@ primop ShrinkMutableByteArrayOp_Char "shrinkMutableByteArray#" GenPrimOp
MutableByteArray# s -> Int# -> State# s -> State# s
{Shrink mutable byte array to new specified size (in bytes), in
the specified state thread. The new size argument must be less than or
- equal to the current size as reported by {\tt sizeofMutableByteArray\#}.}
+ equal to the current size as reported by {\tt getSizeofMutableByteArray\#}.}
with out_of_line = True
has_side_effects = True
@@ -1484,7 +1484,7 @@ primop SizeofByteArrayOp "sizeofByteArray#" GenPrimOp
primop SizeofMutableByteArrayOp "sizeofMutableByteArray#" GenPrimOp
MutableByteArray# s -> Int#
{Return the size of the array in bytes. Note that this is deprecated as it is
- unsafe in the presence of resize operations on the same byte
+ unsafe in the presence of shrink and resize operations on the same mutable byte
array.}
with deprecated_msg = { Use 'getSizeofMutableByteArray#' instead }
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1b508a9e14c7c894ff4f080f099f3947813f41ec
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1b508a9e14c7c894ff4f080f099f3947813f41ec
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200521/c6ab6f93/attachment-0001.html>
More information about the ghc-commits
mailing list