Explorar o código

swap member declaration in StandardGauge to avoid problem with atomic on arm and x86-32

fg2it %!s(int64=9) %!d(string=hai) anos
pai
achega
d3e47e50c1
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      pkg/metrics/gauge.go

+ 2 - 1
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.