11debfc3dSmrg /* Null garbage collection for the GNU compiler.
2*8feb0f0bSmrg Copyright (C) 1998-2020 Free Software Foundation, Inc.
31debfc3dSmrg
41debfc3dSmrg This file is part of GCC.
51debfc3dSmrg
61debfc3dSmrg GCC is free software; you can redistribute it and/or modify it
71debfc3dSmrg under the terms of the GNU General Public License as published by
81debfc3dSmrg the Free Software Foundation; either version 3, or (at your option)
91debfc3dSmrg any later version.
101debfc3dSmrg
111debfc3dSmrg GCC is distributed in the hope that it will be useful, but WITHOUT
121debfc3dSmrg ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
131debfc3dSmrg or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
141debfc3dSmrg License for more details.
151debfc3dSmrg
161debfc3dSmrg You should have received a copy of the GNU General Public License
171debfc3dSmrg along with GCC; see the file COPYING3. If not see
181debfc3dSmrg <http://www.gnu.org/licenses/>. */
191debfc3dSmrg
201debfc3dSmrg /* This version is used by the gen* programs and certain language-specific
211debfc3dSmrg targets (such as java), where we don't really need GC at all.
221debfc3dSmrg This prevents problems with pulling in all the tree stuff. */
231debfc3dSmrg
241debfc3dSmrg #ifdef GENERATOR_FILE
251debfc3dSmrg #include "bconfig.h"
261debfc3dSmrg #else
271debfc3dSmrg #include "config.h"
281debfc3dSmrg #endif
291debfc3dSmrg
301debfc3dSmrg #include "system.h"
311debfc3dSmrg #include "coretypes.h"
321debfc3dSmrg #include "hash-table.h"
331debfc3dSmrg
341debfc3dSmrg /* For a given size of memory requested for allocation, return the
351debfc3dSmrg actual size that is going to be allocated. */
361debfc3dSmrg
371debfc3dSmrg size_t
ggc_round_alloc_size(size_t requested_size)381debfc3dSmrg ggc_round_alloc_size (size_t requested_size)
391debfc3dSmrg {
401debfc3dSmrg return requested_size;
411debfc3dSmrg }
421debfc3dSmrg
431debfc3dSmrg void *
ggc_internal_alloc(size_t size,void (* f)(void *),size_t,size_t MEM_STAT_DECL)441debfc3dSmrg ggc_internal_alloc (size_t size, void (*f)(void *), size_t, size_t
451debfc3dSmrg MEM_STAT_DECL)
461debfc3dSmrg {
471debfc3dSmrg gcc_assert (!f); // ggc-none doesn't support finalizers
481debfc3dSmrg return xmalloc (size);
491debfc3dSmrg }
501debfc3dSmrg
511debfc3dSmrg void *
ggc_internal_cleared_alloc(size_t size,void (* f)(void *),size_t,size_t MEM_STAT_DECL)521debfc3dSmrg ggc_internal_cleared_alloc (size_t size, void (*f)(void *), size_t, size_t
531debfc3dSmrg MEM_STAT_DECL)
541debfc3dSmrg {
551debfc3dSmrg gcc_assert (!f); // ggc-none doesn't support finalizers
561debfc3dSmrg return xcalloc (size, 1);
571debfc3dSmrg }
581debfc3dSmrg
591debfc3dSmrg void *
ggc_realloc_stat(void * x,size_t size MEM_STAT_DECL)601debfc3dSmrg ggc_realloc_stat (void *x, size_t size MEM_STAT_DECL)
611debfc3dSmrg {
621debfc3dSmrg return xrealloc (x, size);
631debfc3dSmrg }
641debfc3dSmrg
651debfc3dSmrg void
ggc_free(void * p)661debfc3dSmrg ggc_free (void *p)
671debfc3dSmrg {
681debfc3dSmrg free (p);
691debfc3dSmrg }
701debfc3dSmrg
711debfc3dSmrg void
ggc_grow(void)721debfc3dSmrg ggc_grow (void)
731debfc3dSmrg {
741debfc3dSmrg }
75c0a68be4Smrg
76c0a68be4Smrg void
ggc_trim(void)77c0a68be4Smrg ggc_trim (void)
78c0a68be4Smrg {
79c0a68be4Smrg }
80