runtime: convert slice operations to Go.
LGTM=bradfitz, dvyukov
R=golang-codereviews, bradfitz, dvyukov
CC=golang-codereviews
https://golang.org/cl/120190044
diff --git a/src/pkg/runtime/malloc.go b/src/pkg/runtime/malloc.go
index cac8f96..255778b 100644
--- a/src/pkg/runtime/malloc.go
+++ b/src/pkg/runtime/malloc.go
@@ -232,6 +232,12 @@
return gomallocgc(uintptr(typ.size)*n, typ, flags)
}
+// rawmem returns a chunk of pointerless memory. It is
+// not zeroed.
+func rawmem(size uintptr) unsafe.Pointer {
+ return gomallocgc(size, nil, flagNoScan|flagNoZero)
+}
+
// round size up to next size class
func goroundupsize(size uintptr) uintptr {
if size < maxSmallSize {