From 3945d0d91434fce9606bf7749169b98c5f534515 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 19 Jan 2010 10:38:25 +0000 Subject: [PATCH] Fix docs for sizeofByteArray#/sizeofMutableByteArray# (#3800) In 6.14.1 we'll switch these primops to return the exact byte size, but for 6.12.2 we need to fix the docs. --- compiler/prelude/primops.txt.pp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index 3aa093a..fc99dee 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -632,14 +632,15 @@ primop UnsafeThawArrayOp "unsafeThawArray#" GenPrimOp ------------------------------------------------------------------------ section "Byte Arrays" {Operations on {\tt ByteArray\#}. A {\tt ByteArray\#} is a just a region of - raw memory in the garbage-collected heap, which is not scanned - for pointers. It carries its own size (in bytes). There are - three sets of operations for accessing byte array contents: - index for reading from immutable byte arrays, and read/write - for mutable byte arrays. Each set contains operations for - a range of useful primitive data types. Each operation takes - an offset measured in terms of the size fo the primitive type - being read or written.} + raw memory in the garbage-collected heap, which is not + scanned for pointers. It carries its own size (in bytes, + rounded up to the nearest multiple of a word). There are + three sets of operations for accessing byte array contents: + index for reading from immutable byte arrays, and read/write + for mutable byte arrays. Each set contains operations for a + range of useful primitive data types. Each operation takes + an offset measured in terms of the size fo the primitive type + being read or written.} ------------------------------------------------------------------------ @@ -681,10 +682,13 @@ primop UnsafeFreezeByteArrayOp "unsafeFreezeByteArray#" GenPrimOp primop SizeofByteArrayOp "sizeofByteArray#" GenPrimOp ByteArray# -> Int# + {Return the size of the array in bytes, rounded up to the nearest multiple + of a word.} primop SizeofMutableByteArrayOp "sizeofMutableByteArray#" GenPrimOp MutableByteArray# s -> Int# - + {Return the size of the array in bytes, rounded up to the nearest multiple + of a word.} primop IndexByteArrayOp_Char "indexCharArray#" GenPrimOp ByteArray# -> Int# -> Char# -- 1.7.10.4