Should we always inline newByteArray#?

Johan Tibell johan.tibell at gmail.com
Thu Mar 13 21:36:09 UTC 2014


On Thu, Mar 13, 2014 at 10:24 PM, Simon Marlow <marlowsd at gmail.com> wrote:
>
> It's a bad idea for large arrays (>= 3k), because when allocated via
> allocate() these arrays get a blocked marked with BF_LARGE that doesn't get
> copied during GC.
>
> It might be a good idea for arrays less than this size (including the
> header).  It's a bad idea if the size isn't statically known, though.
>

Sorry for not being clear. We will only do the inline *allocation* if the
size <= 128 bytes. I'm talking about always inlining the *code* (whether it
contains a call to allocate or not). In one case we will inline a
definition reusing the heap check. In the other case we will inline a
definition that calls allocate.

-- Johan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20140313/518147ab/attachment.html>


More information about the ghc-devs mailing list