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

Bulat Ziganshin bulat.ziganshin at gmail.com
Mon Apr 28 08:23:36 EDT 2008


Hello Verma,

Monday, April 28, 2008, 4:11:51 PM, you wrote:

>       newCString str

> Now once I call this function from C code, I am freeing the allocated
> memory using free function. I want to confirm that this is the right
> thing to do.

yes, i've traced this function down to mallocArray -> mallocBytes ->
malloc() calls


-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list