mirror of
https://github.com/mailgun/groupcache.git
synced 2024-11-16 14:10:04 +00:00
parent
a6b377e340
commit
d092608c06
@ -166,6 +166,8 @@ type Group struct {
|
||||
// concurrent callers.
|
||||
loadGroup flightGroup
|
||||
|
||||
_ int32 // force Stats to be 8-byte aligned on 32-bit platforms
|
||||
|
||||
// Stats are statistics on the group.
|
||||
Stats Stats
|
||||
}
|
||||
|
@ -27,6 +27,7 @@ import (
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
"unsafe"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
|
||||
@ -443,5 +444,13 @@ func TestNoDedup(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestGroupStatsAlignment(t *testing.T) {
|
||||
var g Group
|
||||
off := unsafe.Offsetof(g.Stats)
|
||||
if off%8 != 0 {
|
||||
t.Fatal("Stats structure is not 8-byte aligned.")
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(bradfitz): port the Google-internal full integration test into here,
|
||||
// using HTTP requests instead of our RPC system.
|
||||
|
Loading…
Reference in New Issue
Block a user