diff --git a/internal/buffer/out_message.go b/internal/buffer/out_message.go index b0d1f81..3c821f6 100644 --- a/internal/buffer/out_message.go +++ b/internal/buffer/out_message.go @@ -55,22 +55,8 @@ func init() { // Reset resets m so that it's ready to be used again. Afterward, the contents // are solely a zeroed fusekernel.OutHeader struct. func (m *OutMessage) Reset() { - // Ideally we'd like to write: - // - // m.payloadOffset = 0 - // m.header = fusekernel.OutHeader{} - // - // But Go 1.8 beta 2 generates bad code for this - // (https://golang.org/issue/18370). Encourage it to generate the same code - // as Go 1.7.4 did. - if unsafe.Offsetof(m.payload) != 24 { - panic("unexpected OutMessage layout") - } - - a := (*[3]uint64)(unsafe.Pointer(m)) - a[0] = 0 - a[1] = 0 - a[2] = 0 + m.payloadOffset = 0 + m.header = fusekernel.OutHeader{} } // OutHeader returns a pointer to the header at the start of the message. diff --git a/internal/buffer/runtime_go1.8.s b/internal/buffer/runtime_go1.8.s index 201a511..01d34e9 100644 --- a/internal/buffer/runtime_go1.8.s +++ b/internal/buffer/runtime_go1.8.s @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build amd64 arm64 ppc64 ppc64le +// +build amd64 arm64 ppc64 ppc64le arm // +build go1.8 // Assembly code isn't subject to visibility restrictions, so we can jump @@ -23,6 +23,9 @@ #include "textflag.h" +#ifdef GOARCH_arm +#define JMP B +#endif #ifdef GOARCH_ppc64 #define JMP BR #endif diff --git a/internal/buffer/runtime_other.s b/internal/buffer/runtime_other.s index 139cc65..980f64e 100644 --- a/internal/buffer/runtime_other.s +++ b/internal/buffer/runtime_other.s @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// +build amd64 arm64 ppc64 ppc64le +// +build amd64 arm64 ppc64 ppc64le arm // +build !go1.8 // Assembly code isn't subject to visibility restrictions, so we can jump @@ -23,6 +23,9 @@ #include "textflag.h" +#ifdef GOARCH_arm +#define JMP B +#endif #ifdef GOARCH_ppc64 #define JMP BR #endif