소스 검색

Merge pull request #6768 from fg2it/fix6749

fix 6749 by swapping member in StandardGauge to avoid problem with atomic
Carl Bergquist 9 년 전
부모
커밋
6c03c64c79
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  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.