4 ms·
I think this is becoming a semantic argument. I think we all understand that Rust/C++ closures don't necessarily allocate memory. His point is simply that by u
by saynsedit 10y ago
I think this is becoming a semantic argument.
I think we all understand that Rust/C++ closures don't necessarily allocate memory. His point is simply that by using a rust closure to asynchronously handle an event a heap allocation must be done. Compare to the stack swapping method of classical coroutines, which wouldn't require a heap allocation.
I recognize that with Rust zero-cost futures, one big heap allocation is done for the entire futures combination and is roughly analogous to one big eager stack allocation for a coroutine.
- steveklabnik 10y agoYes, I think so too. I just want to make sure the semantics are clear. I think your summary here is excellent.