aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/string.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-08-27 21:59:49 -0400
committerRuss Cox <rsc@golang.org>2014-08-27 21:59:49 -0400
commitd21638b5ec7210e1597b96db6698471d8141a5b2 (patch)
treef1532c635d6c8a4343c4e1061c7dd180f3cbc980 /src/pkg/runtime/string.go
parent43d4f93c91587323d6141dcd4cbcccb0ee8bfab3 (diff)
downloadgo-d21638b5ec7210e1597b96db6698471d8141a5b2.tar.xz
cmd/cc, runtime: preserve C runtime type names in generated Go
uintptr or uint64 in the runtime C were turning into uint in the Go, bool was turning into uint8, and so on. Fix that. Also delete Go wrappers for C functions. The C functions can be called directly now (but still eventually need to be converted to Go). LGTM=bradfitz, minux, iant R=golang-codereviews, bradfitz, iant, minux CC=golang-codereviews, khr, r https://golang.org/cl/138740043
Diffstat (limited to 'src/pkg/runtime/string.go')
-rw-r--r--src/pkg/runtime/string.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/pkg/runtime/string.go b/src/pkg/runtime/string.go
index 983125f0ce..72b732f844 100644
--- a/src/pkg/runtime/string.go
+++ b/src/pkg/runtime/string.go
@@ -64,7 +64,7 @@ func slicebytetostring(b []byte) string {
fn := slicebytetostring
racereadrangepc(unsafe.Pointer(&b[0]),
len(b),
- gogetcallerpc(unsafe.Pointer(&b)),
+ getcallerpc(unsafe.Pointer(&b)),
**(**uintptr)(unsafe.Pointer(&fn)))
}
s, c := rawstring(len(b))
@@ -85,7 +85,7 @@ func slicebytetostringtmp(b []byte) string {
fn := slicebytetostringtmp
racereadrangepc(unsafe.Pointer(&b[0]),
len(b),
- gogetcallerpc(unsafe.Pointer(&b)),
+ getcallerpc(unsafe.Pointer(&b)),
**(**uintptr)(unsafe.Pointer(&fn)))
}
return *(*string)(unsafe.Pointer(&b))
@@ -123,7 +123,7 @@ func slicerunetostring(a []rune) string {
fn := slicerunetostring
racereadrangepc(unsafe.Pointer(&a[0]),
len(a)*int(unsafe.Sizeof(a[0])),
- gogetcallerpc(unsafe.Pointer(&a)),
+ getcallerpc(unsafe.Pointer(&a)),
**(**uintptr)(unsafe.Pointer(&fn)))
}
var dum [4]byte
@@ -219,7 +219,7 @@ func rawstring(size int) (s string, b []byte) {
for {
ms := maxstring
- if uintptr(size) <= uintptr(ms) || gocasx((*uintptr)(unsafe.Pointer(&maxstring)), uintptr(ms), uintptr(size)) {
+ if uintptr(size) <= uintptr(ms) || casuintptr((*uintptr)(unsafe.Pointer(&maxstring)), uintptr(ms), uintptr(size)) {
return
}
}