From b88e20a4da16115dd69d486dcbb481653262b038 Mon Sep 17 00:00:00 2001 From: Norman Meier Date: Mon, 28 Jun 2021 16:49:04 +0200 Subject: [PATCH] fix(replicator): alignment of atomic int64 fields Signed-off-by: Norman Meier --- stores/replicator/replicator.go | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/stores/replicator/replicator.go b/stores/replicator/replicator.go index 992ab176..38a865b0 100644 --- a/stores/replicator/replicator.go +++ b/stores/replicator/replicator.go @@ -21,20 +21,23 @@ import ( var batchSize = 1 type replicator struct { - events.EventEmitter - - cancelFunc context.CancelFunc - store storeInterface - fetching map[string]cid.Cid + // These require 64 bit alignment for ARM and 32bit devices statsTasksRequested int64 statsTasksStarted int64 statsTasksProcessed int64 - buffer []ipfslog.Log - concurrency int64 - queue map[string]cid.Cid - lock sync.RWMutex - logger *zap.Logger - tracer trace.Tracer + // For more information see https://pkg.go.dev/sync/atomic#pkg-note-BUG + + events.EventEmitter + + cancelFunc context.CancelFunc + store storeInterface + fetching map[string]cid.Cid + buffer []ipfslog.Log + concurrency int64 + queue map[string]cid.Cid + lock sync.RWMutex + logger *zap.Logger + tracer trace.Tracer } func (r *replicator) GetBufferLen() int {