Skip to content

Commit

Permalink
atomic requires struct field to be 64-bit aligned
Browse files Browse the repository at this point in the history
  • Loading branch information
tpng committed Nov 26, 2015
1 parent 0ad3406 commit 6fafcd5
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions memfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6fafcd5

Please sign in to comment.