> `touch' sounds very good to me.  In fact, you might remember
> that we had a discussion about basically the same issue a
> while ago.  (At the time when I lobbied for the inclusion of
> `foreignObjToAddr'.)

Yes I do vaguely remember.  At the time I hadn't noticed that you could
implement "touch" safely and efficiently as a null primop, though.

> In fact, having `touch', we could get rid of the condition
> impossed by the last bulleted item on the page
> 
>   http://haskell.cs.yale.edu/ghc/docs/latest/set/sec-primitive.html
> 
> This condition basically requires the implicit introduction
> of a `touch' by the compiler and so is redundant if we have
> an explicit `touch'.

Yes.  I'm still slightly concerned that in this case the behaviour where the
ForeignObj stays live across the call is normally what you want; requiring
that an explicit touch be used is too fragile.

Cheers,
        Simon

Reply via email to