]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/ggc-none.c
[Ada] Small improvement to Expand_N_Unchecked_Type_Conversion
[thirdparty/gcc.git] / gcc / ggc-none.c
CommitLineData
0a25f1f5 1/* Null garbage collection for the GNU compiler.
8d9254fc 2 Copyright (C) 1998-2020 Free Software Foundation, Inc.
0a25f1f5 3
1322177d 4 This file is part of GCC.
0a25f1f5 5
1322177d
LB
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
9dcd6f09 8 the Free Software Foundation; either version 3, or (at your option)
0a25f1f5
RH
9 any later version.
10
1322177d
LB
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.
0a25f1f5
RH
15
16 You should have received a copy of the GNU General Public License
9dcd6f09
NC
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
0a25f1f5 19
547d057d
ME
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. */
0a25f1f5 23
547d057d 24#ifdef GENERATOR_FILE
7e7ec48e 25#include "bconfig.h"
547d057d
ME
26#else
27#include "config.h"
28#endif
29
0a25f1f5 30#include "system.h"
4977bab6 31#include "coretypes.h"
13fdf2e2 32#include "hash-table.h"
7e7ec48e 33
b9bd6f74
TT
34/* For a given size of memory requested for allocation, return the
35 actual size that is going to be allocated. */
36
37size_t
38ggc_round_alloc_size (size_t requested_size)
39{
40 return requested_size;
41}
42
005537df 43void *
de49ce19
TS
44ggc_internal_alloc (size_t size, void (*f)(void *), size_t, size_t
45 MEM_STAT_DECL)
0a25f1f5 46{
de49ce19 47 gcc_assert (!f); // ggc-none doesn't support finalizers
f8a83ee3 48 return xmalloc (size);
0a25f1f5 49}
e2500fed
GK
50
51void *
de49ce19
TS
52ggc_internal_cleared_alloc (size_t size, void (*f)(void *), size_t, size_t
53 MEM_STAT_DECL)
e2500fed 54{
de49ce19 55 gcc_assert (!f); // ggc-none doesn't support finalizers
e2500fed
GK
56 return xcalloc (size, 1);
57}
58
59void *
b9dcdee4 60ggc_realloc_stat (void *x, size_t size MEM_STAT_DECL)
e2500fed
GK
61{
62 return xrealloc (x, size);
63}
9fcdd891
JM
64
65void
66ggc_free (void *p)
67{
68 free (p);
69}
fd1e9302
JH
70
71void
72ggc_grow (void)
73{
74}
e5207f1a
JH
75
76void
77ggc_trim (void)
78{
79}