[EMAIL PROTECTED] (Marcin 'Qrczak' Kowalczyk) wrote, > Wed, 16 Aug 2000 07:32:48 -0700, Simon Marlow <[EMAIL PROTECTED]> pisze: > > > I'm not sure I understand; how does autoPtrToBytes work if it > > doesn't use a ForeignObj? > > autoPtrToBytes:: Int -> IO (Ptr a) > autoPtrToBytes size = do > ptr <- mallocBytes size > addFinalizer ptr (free ptr) > return ptr This looks very nice. My only concern is that `addFinalizer' is a weak pointer operation, and thus, not part of the core FFI (which only provides ForeignObj and StablePtr). Simon, could you give us an idea how easy or difficult it would be to implement addFinalizer without having all of weak pointers?[1] Cheers, Manuel [1] I don't have anything against weak pointers. This is again only my "minimise the extension creep" paranoia in the hope to have a portable FFI. Malcolm, do you have any comments on addFinalizer as part of the core FFI?
- Accessing ForeignObj contents from Haskell Marcin 'Qrczak' Kowalczyk
- RE: Accessing ForeignObj contents from Hask... Simon Marlow
- Re: Accessing ForeignObj contents from ... Marcin 'Qrczak' Kowalczyk
- Re: Accessing ForeignObj contents f... Marcin 'Qrczak' Kowalczyk
- Re: Accessing ForeignObj conten... Marcin 'Qrczak' Kowalczyk
- RE: Accessing ForeignObj contents from Hask... Simon Marlow
- RE: Accessing ForeignObj contents from ... Manuel M. T. Chakravarty
- RE: Accessing ForeignObj contents from Hask... Simon Marlow
- Re: Accessing ForeignObj contents from ... Marcin 'Qrczak' Kowalczyk
- RE: Accessing ForeignObj contents f... Manuel M. T. Chakravarty
- RE: Accessing ForeignObj contents from Hask... Simon Marlow
- Re: Accessing ForeignObj contents from ... Keith Wansbrough
- Re: Accessing ForeignObj contents f... Marcin 'Qrczak' Kowalczyk
- Re: Accessing ForeignObj contents from ... Marcin 'Qrczak' Kowalczyk
- Re: Accessing ForeignObj contents f... Manuel M. T. Chakravarty
- Re: Accessing ForeignObj conten... Marcin 'Qrczak' Kowalczyk
- Re: Accessing ForeignObj c... Manuel M. T. Chakravarty
- RE: Accessing ForeignObj contents from ... Axel Simon
- Re: Accessing ForeignObj contents f... Marcin 'Qrczak' Kowalczyk
- Re: Accessing ForeignObj contents f... Marcin 'Qrczak' Kowalczyk