[Patch 2/7 s390] Deprecate *_BY_PIECES_P, move to hookized version
[official-gcc.git] / libgo / runtime / go-new.c
blobdad6efb30c0cc3f0c3dd00779334afb4fe203d4c
1 /* go-new.c -- the generic go new() function.
3 Copyright 2009 The Go Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style
5 license that can be found in the LICENSE file. */
7 #include "go-alloc.h"
8 #include "runtime.h"
9 #include "arch.h"
10 #include "malloc.h"
12 void *
13 __go_new (const struct __go_type_descriptor *td, uintptr_t size)
15 return runtime_mallocgc (size,
16 (uintptr) td | TypeInfo_SingleObject,
17 0);
20 void *
21 __go_new_nopointers (const struct __go_type_descriptor *td, uintptr_t size)
23 return runtime_mallocgc (size,
24 (uintptr) td | TypeInfo_SingleObject,
25 FlagNoScan);