apd.BigInt / math/big.Int interop // MathBigInt returns the math/big.Int representation of z.
()
| 1016 | |
| 1017 | // MathBigInt returns the math/big.Int representation of z. |
| 1018 | func (z *BigInt) MathBigInt() *big.Int { |
| 1019 | var tmp1 big.Int //gcassert:noescape |
| 1020 | zi := z.inner(&tmp1) |
| 1021 | // NOTE: We can't return zi directly, because it may be pointing into z's |
| 1022 | // _inline array. We have disabled escape analysis for such aliasing, so |
| 1023 | // this would be unsafe as it would not force the receiver to escape and |
| 1024 | // could leave the return value pointing into stack memory. |
| 1025 | return new(big.Int).Set(zi) |
| 1026 | } |
| 1027 | |
| 1028 | // SetMathBigInt sets z to x and returns z. |
| 1029 | func (z *BigInt) SetMathBigInt(x *big.Int) *BigInt { |