From a44645e13dd938221172aa2a7ca1455d25bd09d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucas=20K=C3=A4ldstr=C3=B6m?= Date: Thu, 10 Mar 2016 07:24:33 +0200 Subject: [PATCH] etcdserver: align 64-bit atomics on 8-byte boundary --- etcdserver/server.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/etcdserver/server.go b/etcdserver/server.go index 418e08715..7b48e16ac 100644 --- a/etcdserver/server.go +++ b/etcdserver/server.go @@ -153,9 +153,13 @@ type Server interface { // EtcdServer is the production implementation of the Server interface type EtcdServer struct { - // r must be the first element to keep 64-bit alignment for atomic + // r and inflightSnapshots must be the first elements to keep 64-bit alignment for atomic // access to fields - r raftNode + + // count the number of inflight snapshots. + // MUST use atomic operation to access this field. + inflightSnapshots int64 + r raftNode cfg *ServerConfig snapCount uint64 @@ -195,10 +199,6 @@ type EtcdServer struct { forceVersionC chan struct{} msgSnapC chan raftpb.Message - - // count the number of inflight snapshots. - // MUST use atomic operation to access this field. - inflightSnapshots int64 } // NewServer creates a new EtcdServer from the supplied configuration. The