From d3e47e50c1b6c8b090ef9f978343c1cf3117e86e Mon Sep 17 00:00:00 2001 From: fg2it Date: Wed, 30 Nov 2016 21:57:18 +0000 Subject: [PATCH] swap member declaration in StandardGauge to avoid problem with atomic on arm and x86-32 --- pkg/metrics/gauge.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/metrics/gauge.go b/pkg/metrics/gauge.go index 59758aa4ecb..cdae5ccff26 100644 --- a/pkg/metrics/gauge.go +++ b/pkg/metrics/gauge.go @@ -61,9 +61,10 @@ func (NilGauge) Value() int64 { return 0 } // StandardGauge is the standard implementation of a Gauge and uses the // sync/atomic package to manage a single int64 value. +// atomic needs 64-bit aligned memory which is ensure for first word type StandardGauge struct { - *MetricMeta value int64 + *MetricMeta } // Snapshot returns a read-only copy of the gauge.