]>
Cypherpunks repositories - gostls13.git/commit
crypto/internal/edwards25519: reduce Point size by reordering fields
Updates #58483
Tested on Linux amd64:
type Element struct {
l0, l1, l2, l3, l4 uint64
}
type PointAfter struct {
x, y, z, t Element
_ incomparable
}
type PointBefore struct {
_ incomparable
x, y, z, t Element
}
type incomparable [0]func()
func main() {
fmt.Println(unsafe.Sizeof(PointAfter{})) // 168
fmt.Println(unsafe.Sizeof(PointBefore{})) // 160
}
Change-Id: I6c4fcb586bbf3febf62b6e54608496ff81685e43
Reviewed-on: https://go-review.googlesource.com/c/go/+/467616
Reviewed-by: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Damien Neil <dneil@google.com>
Run-TryBot: Filippo Valsorda <filippo@golang.org>