4 ms·
> How much memory will it cause to be allocated? In Go, it's impossible to tell because "a" might be captured by a closure, in which case it will be heap-allo
by pcwalton 10y ago
> How much memory will it cause to be allocated?
In Go, it's impossible to tell because "a" might be captured by a closure, in which case it will be heap-allocated. But if escape analysis promoted it to the stack or a register, then it will not allocate memory.