Thanks for the hints, I could finally have a look at it and found that a uint64 value was escaping regardless of the actual function code path. I can reproduce it with this dummy function example:
func foo(cond bool, v int) *int {
if cond {
return &v
}
return nil
}
The compiled function prolog allocates the int value regardless of the fact it's not always needed.
I fixed it for now by declaring a new value in the condition block:
func foo(cond bool, v int) *int {
if cond {
v := v // new declaration in this scope to avoid using function scope
return &v
}
return nil
}
Is it something expected?
Best
--
Julio Guerra