]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix 32-bit build
authorKeith Randall <khr@golang.org>
Thu, 8 Jan 2015 21:34:05 +0000 (13:34 -0800)
committerKeith Randall <khr@golang.org>
Thu, 8 Jan 2015 21:39:57 +0000 (21:39 +0000)
In 32-bit worlds, 8-byte objects are only aligned to 4-byte boundaries.

Change-Id: I91469a9a67b1ee31dd508a4e105c39c815ecde58
Reviewed-on: https://go-review.googlesource.com/2581
Reviewed-by: Keith Randall <khr@golang.org>
src/runtime/export_test.go
src/runtime/runtime_test.go

index 87df7c99e47ab09af09274efde8346c29b5afee7..016938ed4ea76759f1ed58a38b9d6657b043779e 100644 (file)
@@ -117,3 +117,5 @@ func GostringW(w []uint16) (s string) {
 
 var Gostringnocopy = gostringnocopy
 var Maxstring = &maxstring
+
+type Uintreg uintreg
index c4de3e247b29f91590a8cee4eca35a0c7ecd0f98..229d7e27ee5b697ca7c4b5955be346a81e8cde73 100644 (file)
@@ -261,8 +261,8 @@ func TestTrailingZero(t *testing.T) {
                n int64
                z struct{}
        }
-       if unsafe.Sizeof(T2{}) != 16 {
-               t.Errorf("sizeof(%#v)==%d, want 16", T2{}, unsafe.Sizeof(T2{}))
+       if unsafe.Sizeof(T2{}) != 8 + unsafe.Sizeof(Uintreg(0)) {
+               t.Errorf("sizeof(%#v)==%d, want %d", T2{}, unsafe.Sizeof(T2{}), 8 + unsafe.Sizeof(Uintreg(0)))
        }
        type T3 struct {
                n byte