Memory address ◦ Value: 1 byte for each OS splits RAM to prepare virtual memory for each process! (Learn “virtual memory” for more) 0x0000 0x0001 0x0002 0x0003
Each frame = scope • Structure is defined in ABI ◦ Local variables ◦ (Some of) arguments ◦ Position of the previous function stack frame ◦ Position where previous function stopped ◦ etc... a() stack frame • call on line 10 • return to main() 5 7
same size are grouped into span int (8 bytes) struct (8 bytes) struct struct (32 bytes) struct struct int int span 1 (for 8 bytes) span 2 (for 8 bytes) span 3 (for 32 bytes) int int
involves argument copying ◦ Big copy -> huge calculation • Zero allocation isn't justice ◦ Measure the effect with benchmark main() • call on line 3 Var foo() • call on line 3 Var bar() • call on line 3 Var