File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -166,6 +166,8 @@ type Group struct {
166
166
// concurrent callers.
167
167
loadGroup flightGroup
168
168
169
+ _ int32 // force Stats to be 8-byte aligned on 32-bit platforms
170
+
169
171
// Stats are statistics on the group.
170
172
Stats Stats
171
173
}
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import (
27
27
"sync"
28
28
"testing"
29
29
"time"
30
+ "unsafe"
30
31
31
32
"github.com/golang/protobuf/proto"
32
33
@@ -443,5 +444,13 @@ func TestNoDedup(t *testing.T) {
443
444
}
444
445
}
445
446
447
+ func TestGroupStatsAlignment (t * testing.T ) {
448
+ var g Group
449
+ off := unsafe .Offsetof (g .Stats )
450
+ if off % 8 != 0 {
451
+ t .Fatal ("Stats structure is not 8-byte aligned." )
452
+ }
453
+ }
454
+
446
455
// TODO(bradfitz): port the Google-internal full integration test into here,
447
456
// using HTTP requests instead of our RPC system.
You can’t perform that action at this time.
0 commit comments