Intermediate
Go (Golang)
Q57 / 100
What is escape analysis in Go?
Correct! Well done.
Incorrect.
The correct answer is B) The compiler's determination of whether a variable should live on the stack or heap based on whether it escapes the function
B
Correct Answer
The compiler's determination of whether a variable should live on the stack or heap based on whether it escapes the function
Explanation
If a variable's address is taken and stored in a longer-lived location, it escapes to the heap. Stack allocation is cheaper (no GC pressure).
Progress
57/100