]> Cypherpunks.ru repositories - gostls13.git/commit
math/big: make NewInt inlineable and zero allocation
authorKeith Randall <khr@golang.org>
Wed, 8 Jun 2022 20:30:02 +0000 (13:30 -0700)
committerKeith Randall <khr@google.com>
Mon, 8 Aug 2022 17:39:06 +0000 (17:39 +0000)
commitd42b520b037311b406da9fcb564f3ef5f91470d7
tree33d9650d3c4ac7244faf2479fcd9c5862ce8e421
parentc2a9c55823b1ed14f84d8ce8880dbda3f5b01eb0
math/big: make NewInt inlineable and zero allocation

Mark the assembly routines as not escaping their arguments.

Add a special case to NewInt that, when inlined, can do all
of its allocations (a big.Int and a [1]Word) on the stack.

Update #29951

Change-Id: I9bd38c262eb97df98c0ed9874da7daac381243ea
Reviewed-on: https://go-review.googlesource.com/c/go/+/411254
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@google.com>
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Robert Griesemer <gri@google.com>
src/math/big/arith_decl.go
src/math/big/int.go
src/math/big/int_test.go