1*38fd1498Szrj /* Null garbage collection for the GNU compiler.
2*38fd1498Szrj Copyright (C) 1998-2018 Free Software Foundation, Inc.
3*38fd1498Szrj
4*38fd1498Szrj This file is part of GCC.
5*38fd1498Szrj
6*38fd1498Szrj GCC is free software; you can redistribute it and/or modify it
7*38fd1498Szrj under the terms of the GNU General Public License as published by
8*38fd1498Szrj the Free Software Foundation; either version 3, or (at your option)
9*38fd1498Szrj any later version.
10*38fd1498Szrj
11*38fd1498Szrj GCC is distributed in the hope that it will be useful, but WITHOUT
12*38fd1498Szrj ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
13*38fd1498Szrj or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
14*38fd1498Szrj License for more details.
15*38fd1498Szrj
16*38fd1498Szrj You should have received a copy of the GNU General Public License
17*38fd1498Szrj along with GCC; see the file COPYING3. If not see
18*38fd1498Szrj <http://www.gnu.org/licenses/>. */
19*38fd1498Szrj
20*38fd1498Szrj /* This version is used by the gen* programs and certain language-specific
21*38fd1498Szrj targets (such as java), where we don't really need GC at all.
22*38fd1498Szrj This prevents problems with pulling in all the tree stuff. */
23*38fd1498Szrj
24*38fd1498Szrj #ifdef GENERATOR_FILE
25*38fd1498Szrj #include "bconfig.h"
26*38fd1498Szrj #else
27*38fd1498Szrj #include "config.h"
28*38fd1498Szrj #endif
29*38fd1498Szrj
30*38fd1498Szrj #include "system.h"
31*38fd1498Szrj #include "coretypes.h"
32*38fd1498Szrj #include "hash-table.h"
33*38fd1498Szrj
34*38fd1498Szrj /* For a given size of memory requested for allocation, return the
35*38fd1498Szrj actual size that is going to be allocated. */
36*38fd1498Szrj
37*38fd1498Szrj size_t
ggc_round_alloc_size(size_t requested_size)38*38fd1498Szrj ggc_round_alloc_size (size_t requested_size)
39*38fd1498Szrj {
40*38fd1498Szrj return requested_size;
41*38fd1498Szrj }
42*38fd1498Szrj
43*38fd1498Szrj void *
ggc_internal_alloc(size_t size,void (* f)(void *),size_t,size_t MEM_STAT_DECL)44*38fd1498Szrj ggc_internal_alloc (size_t size, void (*f)(void *), size_t, size_t
45*38fd1498Szrj MEM_STAT_DECL)
46*38fd1498Szrj {
47*38fd1498Szrj gcc_assert (!f); // ggc-none doesn't support finalizers
48*38fd1498Szrj return xmalloc (size);
49*38fd1498Szrj }
50*38fd1498Szrj
51*38fd1498Szrj void *
ggc_internal_cleared_alloc(size_t size,void (* f)(void *),size_t,size_t MEM_STAT_DECL)52*38fd1498Szrj ggc_internal_cleared_alloc (size_t size, void (*f)(void *), size_t, size_t
53*38fd1498Szrj MEM_STAT_DECL)
54*38fd1498Szrj {
55*38fd1498Szrj gcc_assert (!f); // ggc-none doesn't support finalizers
56*38fd1498Szrj return xcalloc (size, 1);
57*38fd1498Szrj }
58*38fd1498Szrj
59*38fd1498Szrj void *
ggc_realloc_stat(void * x,size_t size MEM_STAT_DECL)60*38fd1498Szrj ggc_realloc_stat (void *x, size_t size MEM_STAT_DECL)
61*38fd1498Szrj {
62*38fd1498Szrj return xrealloc (x, size);
63*38fd1498Szrj }
64*38fd1498Szrj
65*38fd1498Szrj void
ggc_free(void * p)66*38fd1498Szrj ggc_free (void *p)
67*38fd1498Szrj {
68*38fd1498Szrj free (p);
69*38fd1498Szrj }
70*38fd1498Szrj
71*38fd1498Szrj void
ggc_grow(void)72*38fd1498Szrj ggc_grow (void)
73*38fd1498Szrj {
74*38fd1498Szrj }
75