What are the preconditions of newArray#

Edward Z. Yang ezyang at MIT.EDU
Mon Aug 22 05:55:12 CEST 2011

stg_newArrayzh in rts/PrimOps.cmm doesn't appear to give any indication,
so this might be a good patch to add.  But I'm curious: what would
allocating Array#s of size 0 do? Null pointers? That sounds dangerous...


Excerpts from Johan Tibell's message of Fri Aug 19 11:04:48 -0400 2011:
> Hi,
> I'm seeing a segfault which I suspect is due to allocating Array#s of
> size 0, using newArray#. Are zero length arrays allowed? What are the
> preconditions of newArray#? It'd be great if they were documented.
> -- Johan

More information about the Glasgow-haskell-users mailing list