Retro68/gcc/libgo/runtime/go-unsafe-newarray.c

26 lines
729 B
C
Raw Normal View History

2012-03-27 23:13:14 +00:00
/* go-unsafe-newarray.c -- unsafe.NewArray function for Go.
Copyright 2009 The Go Authors. All rights reserved.
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file. */
#include "runtime.h"
2014-09-21 17:33:12 +00:00
#include "arch.h"
#include "malloc.h"
2012-03-27 23:13:14 +00:00
#include "go-type.h"
#include "interface.h"
/* Implement unsafe_NewArray, called from the reflect package. */
2014-09-21 17:33:12 +00:00
void *unsafe_NewArray (const struct __go_type_descriptor *, intgo)
__asm__ (GOSYM_PREFIX "reflect.unsafe_NewArray");
2012-03-27 23:13:14 +00:00
/* The dynamic type of the argument will be a pointer to a type
descriptor. */
void *
2014-09-21 17:33:12 +00:00
unsafe_NewArray (const struct __go_type_descriptor *descriptor, intgo n)
2012-03-27 23:13:14 +00:00
{
2014-09-21 17:33:12 +00:00
return runtime_cnewarray (descriptor, n);
2012-03-27 23:13:14 +00:00
}