Using mutable array after an unsafeFreezeArray, and GC details

Simon Marlow marlowsd at
Mon May 12 08:32:30 UTC 2014

On 09/05/2014 19:21, Brandon Simmons wrote:
> A couple of updates: Edward Yang responded here, confirming the sort
> of track I was thinking on:
> And I can report that:
>    1) cloning a frozen array doesn't provide the benefits of creating a
> new array and freezing
>    2) and anyway, I'm seeing some segfaults when cloning, freezing,
> reading then writing in my library
> I'd love to learn if there are any other approaches I might take, e.g.
> maybe with my own CMM primop variants?

I'm not sure exactly what your workload looks like, but if you have 
arrays that tend to be unmodified for long periods of time it's 
sometimes useful to keep them frozen but thaw before mutating.

How large are your arrays? Perhaps the new small array type (in HEAD but 
not 7.8) would help?


More information about the Glasgow-haskell-users mailing list