aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/string.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-04 15:53:45 -0400
committerRuss Cox <rsc@golang.org>2014-09-04 15:53:45 -0400
commitf545b05aaec2d13e664ce48ce2c258bcfce307c4 (patch)
treeb3765343ac5e3089a6bca40974cb6d46d78da013 /src/pkg/runtime/string.go
parentc08d8834ddf8d69daba989a4ee0b5e144fce973d (diff)
downloadgo-f545b05aaec2d13e664ce48ce2c258bcfce307c4.tar.xz
runtime: make more functions safe for Go
Convert no-op race functions. Everything else is tiny and gets NOSPLITs. After this, all that is left on darwin is sysAlloc, panic, and gothrow (all pending). There may be system-specific calls in other builds. LGTM=iant R=golang-codereviews, iant CC=dvyukov, golang-codereviews, khr, r https://golang.org/cl/140240044
Diffstat (limited to 'src/pkg/runtime/string.go')
-rw-r--r--src/pkg/runtime/string.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pkg/runtime/string.go b/src/pkg/runtime/string.go
index 91f33db118..da3160449f 100644
--- a/src/pkg/runtime/string.go
+++ b/src/pkg/runtime/string.go
@@ -62,7 +62,7 @@ func concatstring5(a [5]string) string {
func slicebytetostring(b []byte) string {
if raceenabled && len(b) > 0 {
racereadrangepc(unsafe.Pointer(&b[0]),
- len(b),
+ uintptr(len(b)),
getcallerpc(unsafe.Pointer(&b)),
funcPC(slicebytetostring))
}
@@ -82,7 +82,7 @@ func slicebytetostringtmp(b []byte) string {
if raceenabled && len(b) > 0 {
racereadrangepc(unsafe.Pointer(&b[0]),
- len(b),
+ uintptr(len(b)),
getcallerpc(unsafe.Pointer(&b)),
funcPC(slicebytetostringtmp))
}
@@ -119,7 +119,7 @@ func stringtoslicerune(s string) []rune {
func slicerunetostring(a []rune) string {
if raceenabled && len(a) > 0 {
racereadrangepc(unsafe.Pointer(&a[0]),
- len(a)*int(unsafe.Sizeof(a[0])),
+ uintptr(len(a))*unsafe.Sizeof(a[0]),
getcallerpc(unsafe.Pointer(&a)),
funcPC(slicerunetostring))
}