You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following freehand code I'm concerned that Idris can garbage collect the Foo pointer while it's still in use. I have had mixed experience with using this pattern. Sometimes I get memory errors, sometimes not. But when I did debug it it seemed to fall over after the first time the Idris GC ran.
If this is a bug, perhaps it's OK if it remains as a limitation of finalisers onCollect[Any], if it's documented VERY LOUDLY cos it defeats the whole purpose of the function when used as above, i.e. safe automatic memory management. That said, I can't see when you'd use it in any other way. Would you ever have a pointer that you don't pass back to C? In what scenario are finalisers safe?
The text was updated successfully, but these errors were encountered:
In the following freehand code I'm concerned that Idris can garbage collect the
Foo
pointer while it's still in use. I have had mixed experience with using this pattern. Sometimes I get memory errors, sometimes not. But when I did debug it it seemed to fall over after the first time the Idris GC ran.If this is a bug, perhaps it's OK if it remains as a limitation of finalisers
onCollect[Any]
, if it's documented VERY LOUDLY cos it defeats the whole purpose of the function when used as above, i.e. safe automatic memory management. That said, I can't see when you'd use it in any other way. Would you ever have a pointer that you don't pass back to C? In what scenario are finalisers safe?The text was updated successfully, but these errors were encountered: