Version 3.6.0 #9
Replies: 2 comments 5 replies
-
I'm excited to try this new version and read the paper when I get to it! I'm not quite comfortable with the cactus stack, it's a shame you had to reintroduce it for performance reasons. I hope we can remove it again once the coroutine optimizations become more... advanced? In the optimal case we should not get any |
Beta Was this translation helpful? Give feedback.
-
For a coroutine a bit like this: auto do_the_thing(int arg_a, int arg_b) -> task<int> {
int a = regular_function(arg_a);
int b = regular_function(arg_b);
co_return a + b;
} If this was called from another coroutine then the compiler can calculate the size of the However consider this coroutine: auto do_the_thing(int arg) -> task<int> {
if (arg <= 1) {
co_return 0;
}
int a = do_the_thing(arg - 1);
int b = do_the_thing(arg - 2);
return a + b;
} How big is the coroutine frame? Well, its big enough to fit two integers but, if the compiler wants to (HALO) optimize the recursive calls to struct frame {
int a, b;
frame r1, r2;
}; Which is infinite as it's a recursive type. Hence, any coroutine that is recursive or mutually recursive needs some indirection, which manifests as an allocation. |
Beta Was this translation helpful? Give feedback.
-
Major overhaul - see the ChangeLog.
This discussion was created from the release Version 3.6.0.
Beta Was this translation helpful? Give feedback.
All reactions