From 22407fc8974f89b34b71b697bb5411db30e05b25 Mon Sep 17 00:00:00 2001 From: bergquist Date: Mon, 13 Jun 2016 06:54:13 +0200 Subject: [PATCH] fix(metrics): 64bit aligns standardcounter Due to a bug in golang the 64bit variable i need to come first to be 64bit aligned. https://golang.org/pkg/sync/atomic/#pkg-note-BUG closes #5341 --- pkg/metrics/counter.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/metrics/counter.go b/pkg/metrics/counter.go index 3cce9b7a0a7..8322d370a36 100644 --- a/pkg/metrics/counter.go +++ b/pkg/metrics/counter.go @@ -29,9 +29,8 @@ func RegCounter(name string, tagStrings ...string) Counter { // StandardCounter is the standard implementation of a Counter and uses the // sync/atomic package to manage a single int64 value. type StandardCounter struct { + count int64 //Due to a bug in golang the 64bit variable need to come first to be 64bit aligned. https://golang.org/pkg/sync/atomic/#pkg-note-BUG *MetricMeta - - count int64 } // Clear sets the counter to zero.