J
jankeir
Guest
I would like to know if there is any documentation on when garbage collection fires. We have a quite a bit of code that still relies heavily on persistent procedures. Years ago I wrote a class to start the persistent procedure passed in as a character in the constructor and has a destructor to stop them, the advantage of this is that if you forget to delete it it does not stay around consuming memory but instead is cleaned up by garbage collection. You can use it like this: myProc = new safelib("someproc.p") . run someinternalprocedure in myProc:getHandle(). As soon as myProc goes out of scope the safelib destructor fires and cleans up the procedure. Now this is all nice but you have to define myProc and if you need it for only one internal proc this also works: run someinternalprocedure in new safelib("someproc.p"):getHandle(). This works right now because the destructor for the object created by safelib only fires after the internal procedure has been called. Strictly speaking though I think it would be possible for progress to GC the object immediately after calling getHandle() before the internal procedure is called in the future. So I'm looking for some documentation to see if what I suggest here can be relied upon or if this behavior could change in the future.
Continue reading...
Continue reading...