From cc9ec52d739ec3c9f2a3e9bfdcc98643bee61cca Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Thu, 31 Jul 2014 12:43:40 -0700 Subject: runtime: convert slice operations to Go. LGTM=bradfitz, dvyukov R=golang-codereviews, bradfitz, dvyukov CC=golang-codereviews https://golang.org/cl/120190044 --- src/pkg/runtime/malloc.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/pkg/runtime/malloc.go') diff --git a/src/pkg/runtime/malloc.go b/src/pkg/runtime/malloc.go index cac8f966e7..255778bd2f 100644 --- a/src/pkg/runtime/malloc.go +++ b/src/pkg/runtime/malloc.go @@ -232,6 +232,12 @@ func newarray(typ *_type, n uintptr) unsafe.Pointer { 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 { -- cgit v1.3