Implement `calloc{,Bytes,Array,Array0}` allocators
authorAlex Petrov <alexp@coffeenco.de>
Fri, 5 Dec 2014 20:56:14 +0000 (14:56 -0600)
committerAustin Seipp <austin@well-typed.com>
Sat, 6 Dec 2014 00:36:23 +0000 (18:36 -0600)
commit08610c1fdc7816c74faed40f8a7d3c4b4758709e
tree3ddb2d0489f13c4cbf6d50d183c869ffd0a09875
parentda98592026154264d529e2e235ff396dfd6e7c51
Implement `calloc{,Bytes,Array,Array0}` allocators

Summary:
This adds zero-initialising versions of `malloc{,Bytes,Array,Array0}`

 * Add `calloc` and `callocBytes` to `Foreign.Marshal.Alloc`.
 * Add `callocArray` and `callocArray0` to `Foreign.Marshal.Array`.

Reviewers: ekmett, duncan, austin, hvr

Reviewed By: austin, hvr

Subscribers: ezyang, simonmar, ekmett, duncan, thomie, carter

Projects: #ghc

Differential Revision: https://phabricator.haskell.org/D527

GHC Trac Issues: #9859
libraries/base/Foreign/Marshal/Alloc.hs
libraries/base/Foreign/Marshal/Array.hs
libraries/base/changelog.md