[Haskell-cafe] pointer equality

Chris Smith cdsmith at gmail.com
Wed Jul 20 19:40:04 CEST 2011


On Wed, 2011-07-20 at 13:32 -0400, Brandon Allbery wrote:

> I think it's more correct to say that the compiler is free to do
> things that would lead to false positives if it knows that it's safe
> to do so (and purity means it can find more of those cases, and more
> of them *will* be safe) — but there is no way for it to crowbar
> pointer equality tests in that case.

I have looked up crowbar in a number of dictionaries of slang and
informal usage... and still have no idea what you just said.  Can you
reword it?

The point, I think, is that if pointer equality testing really does what
it says, then there shouldn't *be* any correct implementation in which
false positives are possible.  It seems the claim is that the garbage
collector might be moving things around, have just by chance happened to
place the second value in the spot formerly occupied by the first, and
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!  Then this "false
positives" issue is no different from any of the many other problems
such a bug might trigger.

-- 
Chris Smith





More information about the Haskell-Cafe mailing list