Passing closures as C callbacks with cleanup functions
Ah thanks! I didn't know about `GC_ref` and `GC_unref`
Passing closures as C callbacks with cleanup functions
I'm new here and I've tried searching for this but can't seem to find it. I'm writing nim code that interacts with a callback based C library, think functions like: void do_the_thing(... args ..., void* cb_arg, callback_func_t cb, destroy_func_t cleanup) { ... } Run