re PR target/55981 (std::atomic store is split in two smaller stores)
[gcc.git] / gcc / ggc-none.c
1 /* Null garbage collection for the GNU compiler.
2 Copyright (C) 1998-2013 Free Software Foundation, Inc.
3
4 This file is part of GCC.
5
6 GCC is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
10
11 GCC is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14 License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
19
20 /* This version is used by the gen* programs and certain language-specific
21 targets (such as java), where we don't really need GC at all.
22 This prevents problems with pulling in all the tree stuff. */
23
24 #ifdef GENERATOR_FILE
25 #include "bconfig.h"
26 #else
27 #include "config.h"
28 #endif
29
30 #include "system.h"
31 #include "coretypes.h"
32 #include "ggc.h"
33
34 void *
35 ggc_alloc_typed_stat (enum gt_types_enum ARG_UNUSED (gte), size_t size
36 MEM_STAT_DECL)
37 {
38 return xmalloc (size);
39 }
40
41 /* For a given size of memory requested for allocation, return the
42 actual size that is going to be allocated. */
43
44 size_t
45 ggc_round_alloc_size (size_t requested_size)
46 {
47 return requested_size;
48 }
49
50 void *
51 ggc_internal_alloc_stat (size_t size MEM_STAT_DECL)
52 {
53 return xmalloc (size);
54 }
55
56 void *
57 ggc_internal_cleared_alloc_stat (size_t size MEM_STAT_DECL)
58 {
59 return xcalloc (size, 1);
60 }
61
62 void *
63 ggc_realloc_stat (void *x, size_t size MEM_STAT_DECL)
64 {
65 return xrealloc (x, size);
66 }
67
68 void
69 ggc_free (void *p)
70 {
71 free (p);
72 }
73
74 struct alloc_zone
75 {
76 int dummy;
77 };
78
79 struct alloc_zone rtl_zone;
80 struct alloc_zone tree_zone;
81 struct alloc_zone tree_id_zone;
82
83 #if defined (GGC_ZONE) && !defined (GENERATOR_FILE)
84
85 void *
86 ggc_internal_alloc_zone_stat (size_t size,
87 struct alloc_zone * ARG_UNUSED(z) MEM_STAT_DECL)
88 {
89 return xmalloc (size);
90 }
91
92 void *
93 ggc_internal_cleared_alloc_zone_stat (size_t size,
94 struct alloc_zone * ARG_UNUSED(z)
95 MEM_STAT_DECL)
96 {
97 return xcalloc (size, 1);
98 }
99
100 #endif