I'm trying to pass a Nim string (auto-converted to cstring, I guess) to a C 
function.

The whole thing does work but not consistently (at times, it crashes with " 
malloc: Incorrect checksum for freed object ....: probably modified after being 
freed.") and I imagine it has something to do with the item having been freed 
by the GC.

How do I make it work? As far as I've seen, I cannot use GC_ref with a string. 
So, what am I supposed to do?

Reply via email to