From 6fafcd5853d0ba4e7798a80770945e1ef9734dad Mon Sep 17 00:00:00 2001 From: Benny Ng Date: Thu, 26 Nov 2015 12:04:28 +0800 Subject: [PATCH] atomic requires struct field to be 64-bit aligned fix https://github.com/spf13/hugo/issues/1621 --- memfile.go | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/memfile.go b/memfile.go index 6be5c87..f69d2cd 100644 --- a/memfile.go +++ b/memfile.go @@ -34,16 +34,18 @@ type MemDir interface { } type InMemoryFile struct { - sync.Mutex + // atomic requires 64-bit alignment for struct field access at int64 - name string - data []byte - memDir MemDir - dir bool - closed bool - mode os.FileMode - modtime time.Time readDirCount int64 + + sync.Mutex + name string + data []byte + memDir MemDir + dir bool + closed bool + mode os.FileMode + modtime time.Time } func MemFileCreate(name string) *InMemoryFile {