Hi Nick,
I believe that a closure created with buildClosureX is not automatically
garbage collected because Poly/ML can't know how long a C function is
going to hold on to the callback for. Therefore, I suspect what's
happening is that Poly/ML can't garbage collect the list accum because
Hello.
I found memory leak when FFI callback and ref value.
I checked Poly/ML 5.8 and 5.7.
Simple code for reproduce the memory leak is attached.
To prevent the memory leak I clean ref value (see comment in example).
But It must do the garbage collector, is it? At least MLton have not
this