Skip to content

Commit

Permalink
Merge pull request #23 from tpng/patch-1
Browse files Browse the repository at this point in the history
atomic requires struct field to be 64-bit aligned
  • Loading branch information
mbertschler committed Nov 26, 2015
2 parents 0ad3406 + 6fafcd5 commit 12fcb8c
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 12fcb8c

Please sign in to comment.