Re: [polyml] Memory leak when FFI callback and ref value.

2019-03-14 Thread Phil Clayton
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

[polyml] Memory leak when FFI callback and ref value.

2019-03-14 Thread Kostirya
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