aboutsummaryrefslogtreecommitdiff
path: root/src/runtime/malloc.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-12-22 13:27:53 -0500
committerRuss Cox <rsc@golang.org>2014-12-23 03:17:22 +0000
commit7a524a103647d0b839ff133be1b1b866c92d11fb (patch)
treec5b1f7f352509a9965911eb8fad11900e9c7ebc7 /src/runtime/malloc.go
parent200e7bf6b13a16452e5add94bb641ed434526e37 (diff)
downloadgo-7a524a103647d0b839ff133be1b1b866c92d11fb.tar.xz
runtime: remove thunk.s
Replace with uses of //go:linkname in Go files, direct use of name in .s files. The only one that really truly needs a jump is reflect.call; the jump is now next to the runtime.reflectcall assembly implementations. Change-Id: Ie7ff3020a8f60a8e4c8645fe236e7883a3f23f46 Reviewed-on: https://go-review.googlesource.com/1962 Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/malloc.go')
-rw-r--r--src/runtime/malloc.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/runtime/malloc.go b/src/runtime/malloc.go
index a056808bf7..d7fca7f906 100644
--- a/src/runtime/malloc.go
+++ b/src/runtime/malloc.go
@@ -387,6 +387,11 @@ func newobject(typ *_type) unsafe.Pointer {
return mallocgc(uintptr(typ.size), typ, flags)
}
+//go:linkname reflect_unsafe_New reflect.unsafe_New
+func reflect_unsafe_New(typ *_type) unsafe.Pointer {
+ return newobject(typ)
+}
+
// implementation of make builtin for slices
func newarray(typ *_type, n uintptr) unsafe.Pointer {
flags := uint32(0)
@@ -399,6 +404,11 @@ func newarray(typ *_type, n uintptr) unsafe.Pointer {
return mallocgc(uintptr(typ.size)*n, typ, flags)
}
+//go:linkname reflect_unsafe_NewArray reflect.unsafe_NewArray
+func reflect_unsafe_NewArray(typ *_type, n uintptr) unsafe.Pointer {
+ return newarray(typ, n)
+}
+
// rawmem returns a chunk of pointerless memory. It is
// not zeroed.
func rawmem(size uintptr) unsafe.Pointer {