aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/go-unsafe-newarray.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2013-07-16 06:54:42 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2013-07-16 06:54:42 +0000
commitbe47d6eceffd2c5dbbc1566d5eea490527fb2bd4 (patch)
tree0e8fda573576bb4181dba29d0e88380a8c38fafd /libgo/runtime/go-unsafe-newarray.c
parentefb30cdeb003fd7c585ee0d7657340086abcbd9e (diff)
downloadgcc-be47d6eceffd2c5dbbc1566d5eea490527fb2bd4.zip
gcc-be47d6eceffd2c5dbbc1566d5eea490527fb2bd4.tar.gz
gcc-be47d6eceffd2c5dbbc1566d5eea490527fb2bd4.tar.bz2
libgo: Update to Go 1.1.1.
From-SVN: r200974
Diffstat (limited to 'libgo/runtime/go-unsafe-newarray.c')
-rw-r--r--libgo/runtime/go-unsafe-newarray.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/libgo/runtime/go-unsafe-newarray.c b/libgo/runtime/go-unsafe-newarray.c
index e4fb336..f5c5efc 100644
--- a/libgo/runtime/go-unsafe-newarray.c
+++ b/libgo/runtime/go-unsafe-newarray.c
@@ -21,21 +21,5 @@ void *unsafe_NewArray (const struct __go_type_descriptor *, intgo)
void *
unsafe_NewArray (const struct __go_type_descriptor *descriptor, intgo n)
{
- uint64 size;
- void *ret;
-
- size = n * descriptor->__size;
- if (size == 0)
- ret = &runtime_zerobase;
- else if ((descriptor->__code & GO_NO_POINTERS) != 0)
- ret = runtime_mallocgc (size, FlagNoPointers, 1, 1);
- else
- {
- ret = runtime_mallocgc (size, 0, 1, 1);
-
- if (UseSpanType)
- runtime_settype (ret, (uintptr) descriptor | TypeInfo_Array);
- }
-
- return ret;
+ return runtime_cnewarray (descriptor, n);
}