Skip to content

Commit

Permalink
Merge pull request #79 from berty/fix-atomic-alignment
Browse files Browse the repository at this point in the history
fix(replicator): alignment of atomic int64 fields
  • Loading branch information
n0izn0iz committed Jun 28, 2021
2 parents a85f0cf + b88e20a commit 26bba46
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions stores/replicator/replicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 26bba46

Please sign in to comment.