[Haskell-cafe] FFI Query: How to free a CString allocated in Haskell

Brandon S. Allbery KF8NH allbery at ece.cmu.edu
Tue Apr 29 01:58:40 EDT 2008


On Apr 29, 2008, at 1:45 , Verma Anurag-VNF673 wrote:
> A naïve question I have now after reading your mail. How do I call  
> MarshallAlloc.free from my C code because that's where I need to  
> free it?

Provide a Haskell wrapper function to deallocate / free it, as a  
parallel to the function that allocates and returns it to the C code.

-- 
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allbery at kf8nh.com
system administrator [openafs,heimdal,too many hats] allbery at ece.cmu.edu
electrical and computer engineering, carnegie mellon university    KF8NH




More information about the Haskell-Cafe mailing list