You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a consequence of regabi vs. the old calling convention.
for 386, the slice argument is already on the stack so it just needs to load the parts it needs from the stack.
For amd64, the slice argument is in registers, so it first needs to be spilled to the stack before loading from it.
Taking the address of the slice forces it to be put in memory somewhere, as the compiler doesn't have the analysis capable of figuring out which parts of the address-taken variable are actually read.
Maybe there is something simple we can do for this case.
Using unsafe.SliceData is probably the clearer way to do this anyway, and as a bonus generates the efficient code on all architectures.