On Monday, 19 June 2017 at 09:18:56 UTC, Dsby wrote:
void uses(scope void delegate() dg);
will it be not alloc memory?
I test it , if use scope it will not alloc memony.
Right, using `scope` at the point the delegate variable is
defined means it will never allocate.
On Monday, 19 June 2017 at 09:10:16 UTC, Dsby wrote:
On Saturday, 17 June 2017 at 17:15:50 UTC, Adam D. Ruppe wrote:
On Saturday, 17 June 2017 at 14:19:34 UTC, ANtlord wrote:
[...]
Where the variable is defined that is referenced in the
closure.
So:
[...]
if the uses parma is 'scope':
On Saturday, 17 June 2017 at 17:15:50 UTC, Adam D. Ruppe wrote:
On Saturday, 17 June 2017 at 14:19:34 UTC, ANtlord wrote:
[...]
Where the variable is defined that is referenced in the closure.
So:
[...]
if the uses parma is 'scope':
void uses(scope void delegate() dg);
will it be not
On Saturday, 17 June 2017 at 17:15:50 UTC, Adam D. Ruppe wrote:
On Saturday, 17 June 2017 at 14:19:34 UTC, ANtlord wrote:
Excuse me, I can't get what does it mean "deepest-referenced".
What the deep you mean? The deep of a closure or deep of the
function where the variable is defined. Can you
On Saturday, 17 June 2017 at 14:19:34 UTC, ANtlord wrote:
Excuse me, I can't get what does it mean "deepest-referenced".
What the deep you mean? The deep of a closure or deep of the
function where the variable is defined. Can you give an example
code?
Where the variable is defined that is
On Saturday, 17 June 2017 at 13:13:17 UTC, Adam D. Ruppe wrote:
On Saturday, 17 June 2017 at 13:03:28 UTC, ANtlord wrote:
Is GC called every iteration of this loop?
No, it will once on scope entry; where the deepest-referenced
variable that is actually captured is defined. The compiler
On Saturday, 17 June 2017 at 13:03:28 UTC, ANtlord wrote:
Is GC called every iteration of this loop?
No, it will once on scope entry; where the deepest-referenced
variable that is actually captured is defined. The compiler
allocates heap space instead of stack space for the locals, then
Hello! I can't understand one thing related to closures and
calling of GC. I have the following demo snippet, where a closure
is passed to `receive` function in a loop.
bool isDone = false;
while(!isDone)
receive((bool val){ isDone = val });
Is GC called every iteration of this loop?