[Haskell-cafe] pointer equality

Niklas Larsson metaniklas at gmail.com
Wed Jul 20 19:57:31 CEST 2011


> have not updated the first pointer yet.  But if that's the case, and
> it's executing arbitrary user code that may refer to that memory, then
> the garbage collector contains race conditions!

Not necessarily, if the garbage collection and the move happened
between taking the pointers of the two sides of f1 == f2, it would
update all the references to f1, and the pointer value you just got
would be wrong. Sure it would be unlucky, but there's nothing worse
than a bug that happens once in a billion times.

Niklas



More information about the Haskell-Cafe mailing list