atomic requires struct field to be 64-bit aligned

fix https://github.com/spf13/hugo/issues/1621
This commit is contained in:
Benny Ng 2015-11-26 12:04:28 +08:00
parent 0ad3406941
commit 6fafcd5853
1 changed files with 10 additions and 8 deletions

View File

@ -34,8 +34,11 @@ type MemDir interface {
}
type InMemoryFile struct {
sync.Mutex
// atomic requires 64-bit alignment for struct field access
at int64
readDirCount int64
sync.Mutex
name string
data []byte
memDir MemDir
@ -43,7 +46,6 @@ type InMemoryFile struct {
closed bool
mode os.FileMode
modtime time.Time
readDirCount int64
}
func MemFileCreate(name string) *InMemoryFile {