In particular, it is not obvious to me what the "cost" of TCO in Rust would be. Suppose:
fn A() {
return B();
}
fn C() {
A();
}
then what we have here is:
| stack frame C | stack frame A |
without TCO, we do:
| stack frame C | stack frame A | stack frame B |
then when B returns, we pop B's frame, then pop A's frame. With TCO, we just pop A's frame before hand, and do:
| stack frame C | stack frame B |
instead.
====
Atleast with sysv c abi calling convention, I do not see any additional overhead that TCO creates -- so I am trying to understand: what is the overhead / cost of adding TCO to rust ?