Explorar o código

cpu: define cacheLineSize and doinit for WASM

This fixes a build break when compiling this package with
GOOS=js / GOARCH=wasm.

Updates golang/go#30241

Change-Id: I0b35aa50a69370ed0d83c522e12ce7613c4c3ec4
Reviewed-on: https://go-review.googlesource.com/c/sys/+/165749
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Bryan C. Mills %!s(int64=6) %!d(string=hai) anos
pai
achega
b354f8bf4d
Modificáronse 1 ficheiros con 13 adicións e 0 borrados
  1. 13 0
      cpu/cpu_wasm.go

+ 13 - 0
cpu/cpu_wasm.go

@@ -0,0 +1,13 @@
+// Copyright 2019 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package cpu
+
+// We're compiling the cpu package for an unknown (software-abstracted) CPU.
+// Make CacheLinePad an empty struct and hope that the usual struct alignment
+// rules are good enough.
+
+const cacheLineSize = 0
+
+func doinit() {}