On Thu, Jul 03, 2003 at 01:40:46AM -0400, Derek Elkins wrote:
On Thu, 3 Jul 2003 11:34:08 +0800
[EMAIL PROTECTED] wrote:
If a C function returns a (void*), let's say:
data MyObj = MyObj
foreign import ccall static myobj_ffi.h new_obj newMyObject :: IO
(Ptr MyObj)
ptr -
On Thu, 3 Jul 2003 15:04:26 +0800
[EMAIL PROTECTED] wrote:
On Thu, Jul 03, 2003 at 01:40:46AM -0400, Derek Elkins wrote:
On Thu, 3 Jul 2003 11:34:08 +0800
[EMAIL PROTECTED] wrote:
If a C function returns a (void*), let's say:
data MyObj = MyObj
foreign import ccall static
[EMAIL PROTECTED] wrote:
If a C function returns a (void*), let's say:
data MyObj = MyObj
foreign import ccall static myobj_ffi.h new_obj
newMyObject :: IO (Ptr MyObj)
ptr - newMyObject
should I free the ptr afterwards or not?
There's no single right answer to this - it all depends
[EMAIL PROTECTED] wrote:
So am I right to draw a picture like this? [...]
Basically, yes. Or from the Haskell implementation's view:
I don't have a clue what a Ptr really is, but it fits in C's void*.
[ 1. 2. ]
The requirement for matching allocators and deallocators is not much
different
On Thu, 3 Jul 2003 11:34:08 +0800
[EMAIL PROTECTED] wrote:
If a C function returns a (void*), let's say:
data MyObj = MyObj
foreign import ccall static myobj_ffi.h new_obj newMyObject :: IO
(Ptr MyObj)
ptr - newMyObject
should I free the ptr afterwards or not?
Assuming that it