-
Notifications
You must be signed in to change notification settings - Fork 409
How does the light-weight tail recursion work? #489
Copy link
Copy link
Open
Description
There's a lot of classes in rx-scheduler.hpp like recursed_scope_type, recursed_scope, recursed, recursion, etc.
Is there some general principle tying these together?
Calling what(state->r.get_recurse()); seems to be the general pattern to invoke these, but even after reading the code in rx-scheduler.hpp it's hard to understand what the line of code is actually supposed to do?
Based off history like #2 I am guessing the intent was to eliminate virtual calls.
However it's not obvious how it's doing this, and why simply exhausting the entire queue in a single loop wasn't done instead?
while (!q.empty()) {
auto what = q.pop();
what();
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels