+1, very sensible addition.
+1 here tooadditionally for GHCJS this is a no-brainer since ArrayBuffers (used for data storage when Addr# / Ptr is involved) are initialized to 0 on allocation, making calloc no more expensive than malloc._______________________________________________On Sat, Nov 29, 2014 at 5:05 PM, Oleksandr Petrov <oleksandr.petrov@gmail.com> wrote:Hi everyone,There is a proposal [1] (with implemented revision) to implement zero-initialising versionsof malloc{,Bytes,Array,Array0}
- Add calloc and callocBytes to Foreign.Marshal.Alloc.
- Add callocArray and callocArray0 to Foreign.Marshal.Array.
The benefit is that you can allocate required amount of memory and be certain that it will be cleared(set with zeroes) before you use it. Original discussion took a place in `fillBytes` [1] and waspublicised on that mailing list [2].Please share your thoughts.Thank you.--alex p
_______________________________________________
Libraries mailing list
Libraries@haskell.org
http://www.haskell.org/mailman/listinfo/libraries
Libraries mailing list
Libraries@haskell.org
http://www.haskell.org/mailman/listinfo/libraries