Re: Defining a custom newByteArray primop that uses calloc?

2014-11-26 Thread Carter Schonwald
you cant provide > 1 word alignment guarantees if the bytearray isnt pinned, ... at least with the current RTS setup. (though that would be pretty handy if possible) On Wed, Nov 26, 2014 at 8:55 PM, Erik de Castro Lopo wrote: > Brandon Simmons wrote: > > > In my tests, using calloc from: > > > >

Re: Defining a custom newByteArray primop that uses calloc?

2014-11-26 Thread Erik de Castro Lopo
Brandon Simmons wrote: > In my tests, using calloc from: > > > https://hackage.haskell.org/package/missing-foreign-0.1.1/docs/Foreign-Marshal-MissingAlloc.html > > was about twice as fast as allocating and zeroing the same amount of > memory with `newByteArray` + any of `copy/set/fillMutabl

Defining a custom newByteArray primop that uses calloc?

2014-11-25 Thread Brandon Simmons
In my tests, using calloc from: https://hackage.haskell.org/package/missing-foreign-0.1.1/docs/Foreign-Marshal-MissingAlloc.html was about twice as fast as allocating and zeroing the same amount of memory with `newByteArray` + any of `copy/set/fillMutableByteArray` (all three were nearly ide