[Haskell-cafe] Memory efficiency questions for real-time graphics

Don Stewart dons at galois.com
Mon Oct 27 23:04:21 EDT 2008

> On Mon, Oct 27, 2008 at 10:07 PM, Don Stewart <dons at galois.com> wrote:
> >
> > Seems fine. You'll be working at a low level, with strict, mutable,
> > unboxed data structures, but that's fine: the machine loves them.
> >
> Thanks for the quick reply.  One last question -- is it at all
> possible to segfault with strict, mutable, unboxed structures?  I
> don't quite understand how it knows not to overwrite or underwrite.

It depends on the operations (safe indexing or unsafe indexing).
Being strict or unboxed doesn't determine the safety.

So be careful if you have a 'Ptr a' or start using unsafeWrite.

-- Don

More information about the Haskell-Cafe mailing list