3 ms·
They work fine. Everything is captured by reference, and is ultimately garbage collected. Unlike C++, you're not required to use a special "local function" synt
by Ace17 9y ago
They work fine.
Everything is captured by reference, and is ultimately garbage collected.
Unlike C++, you're not required to use a special "local function" syntax.
- amelius 9y agoInteresting. Is this all guaranteed to work also in a multithreaded environment? How efficient is the garbage collector, and are there pauses?
- p0nce 9y ago> Is this all guaranteed to work also in a multithreaded environment? Yes. > How efficient is the garbage collector, and are there pauses? Not very efficient, and there might be pauses if you are not careful. Now if your closure doesn't escape (just a local function + context) it won't use the GC. So you can use delegates in @nogc code.