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?

I know that I can move the code to a method of a struct and make the closure and variable "isDone" as fields of the struct. It avoids GC calling definitely. But I want to get how many times GC is called in case of a closure in a loop.

Thanks.

Reply via email to