[EMAIL PROTECTED] (Marcin 'Qrczak' Kowalczyk) wrote,

> Wed, 16 Aug 2000 08:06:59 -0700, Simon Marlow <[EMAIL PROTECTED]> pisze:
> 
> > This is a problem we've known about for a while, and it's one reason
> > we have ForeignObj: because they're atomic heap objects and therefore
> > don't suffer from transformational bogosity.
> 
> Oops. I think I understand now how ForeignObjs work.
> 
> So they have to stay. ForeignObj users can use the generic wrapper
>     foreignObjToPtr :: (Ptr a -> IO b) -> ForeignObj -> IO b
> instead of dedicated peek functions.

>From a users point of view, I like these functions that
basically delimit a block by having the stuff in the block
as a higher-order function, but I have two concerns:

* Shouldn't we use

    foreignObjToPtr :: ForeignObj -> (Ptr a -> IO b) -> IO b

  as it allows to write

    foreignObjToPtr fptr $ \ptr -> do
      ...
      ...

* Does GHC usually do inlining here?  In the marshalling
  code for a single function, there can be quite lot of
  these scopes being nested.  Will this have implications on
  program performance?

  Simon, what do you reckon?  Is it inlined usually?

Cheers,
Manuel

Reply via email to