aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/os_darwin_arm64.go
diff options
context:
space:
mode:
authorShenghou Ma <minux@golang.org>2015-04-10 22:14:43 -0400
committerDavid Crawshaw <crawshaw@golang.org>2015-04-16 13:01:19 +0000
commit4a71b91d294189e8ad7de8c10079be6baff3ede4 (patch)
treec8a10e4a0c762c3513f976438b6b6e1b8e8627cf /src/runtime/os_darwin_arm64.go
parent110fa22c4562b0f9ada3c81b9bceeb76763f5608 (diff)
downloadgo-4a71b91d294189e8ad7de8c10079be6baff3ede4.tar.gz
go-4a71b91d294189e8ad7de8c10079be6baff3ede4.zip
runtime: darwin/arm64 support
Change-Id: I3b3f80791a1db4c2b7318f81a115972cd2237f03 Signed-off-by: Shenghou Ma <minux@golang.org> Reviewed-on: https://go-review.googlesource.com/8782 Reviewed-by: David Crawshaw <crawshaw@golang.org>
Diffstat (limited to 'src/runtime/os_darwin_arm64.go')
-rw-r--r--src/runtime/os_darwin_arm64.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/runtime/os_darwin_arm64.go b/src/runtime/os_darwin_arm64.go
new file mode 100644
index 0000000000..4d35af9c6a
--- /dev/null
+++ b/src/runtime/os_darwin_arm64.go
@@ -0,0 +1,13 @@
+// Copyright 2014 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 runtime
+
+//go:nosplit
+func cputicks() int64 {
+ // Currently cputicks() is used in blocking profiler and to seed runtime·fastrand1().
+ // runtime·nanotime() is a poor approximation of CPU ticks that is enough for the profiler.
+ // TODO: need more entropy to better seed fastrand1.
+ return nanotime()
+}