[Haskell-cafe] Can reallyUnsafePtrEquality give false positives?
hesselink at gmail.com
Wed Nov 22 19:12:49 UTC 2017
According to Edwark Kmett it can give false positives as well, or at least
could in 2010:
On 22 November 2017 at 20:06, Andrew Martin <andrew.thaddeus at gmail.com>
> It cannot give false positives. If it could, that would make it totally
> Sent from my iPhone
> > On Nov 22, 2017, at 12:22 PM, Michael Walker <mike at barrucadu.co.uk>
> > Hello,
> > Can reallyUnsafePtrEquality give false positives? I can see how it
> > can give false negatives (eg, compiler optimisations increasing or
> > decreasing sharing), but I'm not so sure if it can give false
> > positives.
> > I don't see how in a garbage collected language two live values could
> > compare reference equal. Unless the implementation is something like:
> > reallyUnsafePtrEquality a b = getptr a == getptr b
> > ...as that then means that if the GC moves things after `getptr a` is
> > evaluated but before `getptr b` is, then you could get a false
> > positive. But that doesn't seem like a sensible implementation to me,
> > because then reallyUnsafePtrEquality would surely be totally useless.
> > --
> > Michael Walker (http://www.barrucadu.co.uk)
> > _______________________________________________
> > Haskell-Cafe mailing list
> > To (un)subscribe, modify options or view archives go to:
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> > Only members subscribed via the mailman list are allowed to post.
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe