mirror of
https://github.com/golang/go
synced 2024-11-26 12:37:57 -07:00
math/big: define Word as uint instead of uintptr
For compatibility with math/bits uint operations. When math/big was written originally, the Go compiler used 32bit int/uint values even on a 64bit machine. uintptr was the type that represented the machine register size. Now, the int/uint types are sized to the native machine register size, so they are the natural machine Word type. On most machines, the size of int/uint correspond to the size of uintptr. On platforms where uint and uintptr have different sizes, this change may lead to performance differences (e.g., amd64p32). Change-Id: Ief249c160b707b6441848f20041e32e9e9d8d8ca Reviewed-on: https://go-review.googlesource.com/37372 Run-TryBot: Robert Griesemer <gri@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
10d718b983
commit
174058038c
@ -1,4 +1,5 @@
|
|||||||
pkg encoding/json, method (*RawMessage) MarshalJSON() ([]uint8, error)
|
pkg encoding/json, method (*RawMessage) MarshalJSON() ([]uint8, error)
|
||||||
|
pkg math/big, type Word uintptr
|
||||||
pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error)
|
pkg net, func ListenUnixgram(string, *UnixAddr) (*UDPConn, error)
|
||||||
pkg os (linux-arm), const O_SYNC = 4096
|
pkg os (linux-arm), const O_SYNC = 4096
|
||||||
pkg os (linux-arm-cgo), const O_SYNC = 4096
|
pkg os (linux-arm-cgo), const O_SYNC = 4096
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
package big
|
package big
|
||||||
|
|
||||||
// A Word represents a single digit of a multi-precision unsigned integer.
|
// A Word represents a single digit of a multi-precision unsigned integer.
|
||||||
type Word uintptr
|
type Word uint
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// Compute the size _S of a Word in bytes.
|
// Compute the size _S of a Word in bytes.
|
||||||
|
Loading…
Reference in New Issue
Block a user