From f545b05aaec2d13e664ce48ce2c258bcfce307c4 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Thu, 4 Sep 2014 15:53:45 -0400 Subject: 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 --- src/pkg/runtime/string.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/pkg/runtime/string.go') 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)) } -- cgit v1.3