aboutsummaryrefslogtreecommitdiffstats
path: root/swarm/storage
diff options
context:
space:
mode:
authorJanoš Guljaš <janos@users.noreply.github.com>2018-09-29 02:04:56 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-09-29 02:04:56 +0800
commit7e1c374dc6311d187b4d75aeaea11d775332076e (patch)
tree1696723c55d0509860e15ebf30750c490c2c46dc /swarm/storage
parent7910dd5179fc70a8bd577f70d573051afcc23aec (diff)
downloadgo-tangerine-7e1c374dc6311d187b4d75aeaea11d775332076e.tar
go-tangerine-7e1c374dc6311d187b4d75aeaea11d775332076e.tar.gz
go-tangerine-7e1c374dc6311d187b4d75aeaea11d775332076e.tar.bz2
go-tangerine-7e1c374dc6311d187b4d75aeaea11d775332076e.tar.lz
go-tangerine-7e1c374dc6311d187b4d75aeaea11d775332076e.tar.xz
go-tangerine-7e1c374dc6311d187b4d75aeaea11d775332076e.tar.zst
go-tangerine-7e1c374dc6311d187b4d75aeaea11d775332076e.zip
swarm/storage: ensure 64bit hasherStore struct alignment (#17766)
Diffstat (limited to 'swarm/storage')
-rw-r--r--swarm/storage/hasherstore.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/swarm/storage/hasherstore.go b/swarm/storage/hasherstore.go
index 879622b9a..ff18e64c7 100644
--- a/swarm/storage/hasherstore.go
+++ b/swarm/storage/hasherstore.go
@@ -32,10 +32,13 @@ type hasherStore struct {
hashFunc SwarmHasher
hashSize int // content hash size
refSize int64 // reference size (content hash + possibly encryption key)
- nrChunks uint64 // number of chunks to store
errC chan error // global error channel
doneC chan struct{} // closed by Close() call to indicate that count is the final number of chunks
quitC chan struct{} // closed to quit unterminated routines
+ // nrChunks is used with atomic functions
+ // it is required to be at the end of the struct to ensure 64bit alignment for arm architecture
+ // see: https://golang.org/pkg/sync/atomic/#pkg-note-BUG
+ nrChunks uint64 // number of chunks to store
}
// NewHasherStore creates a hasherStore object, which implements Putter and Getter interfaces.