Escape Analysis

Go escape analysis

September 20, 2023
Go, Escape Analysis
Note

The meaning of escapes to the heap is variables needs to be shared across the function stack frames [between main() and Println()] …

… So globally access variables must be moved to heap as it requires runtime. So the output line 11:2 shows the same as the data variable moved to the heap memory.

From