Преглед изворни кода

Ensure 64-bit alignment for atomic structures

Operations against EWMA instances were panic'ing on i386 machines. A bug against
golang was file, and it was closed out noting: it is the caller's responsibility
to arrange for 64-bit alignment of 64-bit words accessed atomically.

This comment ensures such alignment for all instances where atomic is being used
to access their fields (ewma was the only offender).

http://code.google.com/p/go/issues/detail?id=6404
Mark Chadwick пре 12 година
родитељ
комит
b9ce5a5715
1 измењених фајлова са 2 додато и 2 уклоњено
  1. 2 2
      ewma.go

+ 2 - 2
ewma.go

@@ -22,10 +22,10 @@ type EWMA interface {
 // to manage uncounted events.
 type StandardEWMA struct {
 	alpha     float64
-	init      bool
-	mutex     sync.Mutex
 	rate      float64
 	uncounted int64
+	init      bool
+	mutex     sync.Mutex
 }
 
 // Force the compiler to check that StandardEWMA implements EWMA.