#3800: sizeofByteArray# returns allocated words, not requested length in bytes
---------------------------------+------------------------------------------
Reporter: AntoineLatter | Owner: AntoineLatter
Type: bug | Status: new
Priority: normal | Component: Compiler
Version: 6.12.1 | Keywords:
Os: Unknown/Multiple | Testcase:
Architecture: Unknown/Multiple | Failure: Incorrect result at runtime
---------------------------------+------------------------------------------
A byte array allocated with (GHC.Prim.newByteArray# 7) will report it's
size as '8' - that is, the stored size in StgArrWords is the number of
allocated words, not the number of requested bytes.
This menas that if I want to a GHC.Prim.ByteArray# or MutableByteArray# as
an array type, I need a separate length fields.
See also: http://www.haskell.org/pipermail/glasgow-haskell-
users/2009-December/018199.html
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3800>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs