3 ms·
I don't get how higher order functions help with deterministic finalization in the case of closures, which typically have an unbounded lifetime. How, and when,
by junke 9y ago
I don't get how higher order functions help with deterministic finalization in the case of closures, which typically have an unbounded lifetime. How, and when, is the resource captured by a closure disposed of?
- pjmlp 9y agoWhen the closure itself is disposed of, depends on the GC algorithm (RC, tracing, parallel...). My point is about other kinds of resources, namely files, database connections, IPC channels, sockets, native memory buffers, transactions and so forth. The call stack of higher order functions can be used as an arena.