From da1abea89e851bca6ba32a562c3ba43b2ce680f2 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 2 Dec 2013 19:01:44 -0800 Subject: [PATCH] readerutil: fix atomic alignment for 32-bit platforms Change-Id: I10eb60a9abbbaf5aeccb1eba9592ff5d354d7985 --- pkg/readerutil/opener.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/readerutil/opener.go b/pkg/readerutil/opener.go index 595e7a0c5..d8a8ffedd 100644 --- a/pkg/readerutil/opener.go +++ b/pkg/readerutil/opener.go @@ -33,9 +33,11 @@ var ( ) type openFile struct { + // refCount must be 64-bit aligned for 32-bit platforms. + refCount int64 // starts at 1; only valid if initial increment >= 2 + *os.File - refCount int64 // starts at 1; only valid if initial increment >= 2 - path string // map key of openFiles + path string // map key of openFiles } func (f *openFile) Close() error {