math/big: don't force second arg to Jacobi and Int.ModSqrt to escape#50527
math/big: don't force second arg to Jacobi and Int.ModSqrt to escape#50527nvb wants to merge 1 commit intogolang:masterfrom
Conversation
This CL updates big.Jacobi to avoid forcing its y argument to escape to the heap. The argument was escaping because it was being passed through an empty interface to fmt.Sprintf during an assertion failure. As a result, callers of Jacobi and Int.ModSqrt (which calls Jacobi) could not keep this value on the stack. Noticed when working on cockroachdb/apd#103.
|
This PR (HEAD: 3ee07b5) has been imported to Gerrit for code review. Please visit https://go-review.googlesource.com/c/go/+/377014 to see it. Tip: You can toggle comments from me using the |
|
Message from Robert Griesemer: Patch Set 1: Run-TryBot+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/377014. |
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/377014. |
|
Message from Gopher Robot: Patch Set 1: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/377014. |
|
Message from Robert Griesemer: Patch Set 1: Code-Review+2 Please don’t reply on this GitHub thread. Visit golang.org/cl/377014. |
|
Message from Robert Griesemer: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/377014. |
|
Message from Filippo Valsorda: Patch Set 1: Code-Review+2 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/377014. |
|
Message from Ian Lance Taylor: Patch Set 2: Patch Set 1 was rebased Please don’t reply on this GitHub thread. Visit golang.org/cl/377014. |
|
Message from Ian Lance Taylor: Patch Set 2: Run-TryBot+1 Auto-Submit+1 Code-Review+1 Please don’t reply on this GitHub thread. Visit golang.org/cl/377014. |
|
Message from Gopher Robot: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/377014. |
|
Message from Gopher Robot: Patch Set 2: TryBot-Result+1 (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/377014. |
This CL updates big.Jacobi to avoid forcing its y argument to escape to the heap. The argument was escaping because it was being passed through an empty interface to fmt.Sprintf during an assertion failure. As a result, callers of Jacobi and Int.ModSqrt (which calls Jacobi) could not keep this value on the stack. Noticed when working on cockroachdb/apd#103. Change-Id: I5db9ee2149bf13b921886929425861721b53b085 GitHub-Last-Rev: 3ee07b5 GitHub-Pull-Request: #50527 Reviewed-on: https://go-review.googlesource.com/c/go/+/377014 Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> Run-TryBot: Ian Lance Taylor <iant@google.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Filippo Valsorda <filippo@golang.org>
|
This PR is being closed because golang.org/cl/377014 has been merged. |
This CL updates big.Jacobi to avoid forcing its y argument to escape
to the heap. The argument was escaping because it was being passed
through an empty interface to fmt.Sprintf during an assertion failure.
As a result, callers of Jacobi and Int.ModSqrt (which calls Jacobi)
could not keep this value on the stack.
Noticed when working on cockroachdb/apd#103.