Mercurial > hg > CbC > CbC_gcc
diff gcc/ggc.h @ 145:1830386684a0
gcc-9.2.0
author | anatofuz |
---|---|
date | Thu, 13 Feb 2020 11:34:05 +0900 |
parents | 84e7813d76e9 |
children |
line wrap: on
line diff
--- a/gcc/ggc.h Thu Oct 25 07:37:49 2018 +0900 +++ b/gcc/ggc.h Thu Feb 13 11:34:05 2020 +0900 @@ -1,6 +1,6 @@ /* Garbage collection for the GNU compiler. - Copyright (C) 1998-2018 Free Software Foundation, Inc. + Copyright (C) 1998-2020 Free Software Foundation, Inc. This file is part of GCC. @@ -149,7 +149,7 @@ /* Free a block. To be used when known for certain it's not reachable. */ extern void ggc_free (void *); -extern void dump_ggc_loc_statistics (bool); +extern void dump_ggc_loc_statistics (); /* Reallocator. */ #define GGC_RESIZEVEC(T, P, N) \ @@ -185,6 +185,18 @@ PASS_MEM_STAT)); } +/* GGC allocation function that does not call finalizer for type + that have need_finalization_p equal to true. User is responsible + for calling of the destructor. */ + +template<typename T> +inline T * +ggc_alloc_no_dtor (ALONE_CXX_MEM_STAT_INFO) +{ + return static_cast<T *> (ggc_internal_alloc (sizeof (T), NULL, 0, 1 + PASS_MEM_STAT)); +} + template<typename T> inline T * ggc_cleared_alloc (ALONE_CXX_MEM_STAT_INFO) @@ -230,6 +242,16 @@ return ggc_internal_alloc (s PASS_MEM_STAT); } +/* Call destructor and free the garbage collected memory. */ + +template <typename T> +inline void +ggc_delete (T *ptr) +{ + ptr->~T (); + ggc_free (ptr); +} + /* Allocate a gc-able string, and fill it with LENGTH bytes from CONTENTS. If LENGTH is -1, then CONTENTS is assumed to be a null-terminated string and the memory sized accordingly. */ @@ -243,6 +265,9 @@ function is called, not during allocations. */ extern void ggc_collect (void); +/* Return unused memory pages to the system. */ +extern void ggc_trim (void); + /* Assume that all GGC memory is reachable and grow the limits for next collection. */ extern void ggc_grow (void); @@ -263,6 +288,9 @@ /* Heuristics. */ extern void init_ggc_heuristics (void); +/* Report current heap memory use to stderr. */ +extern void report_heap_memory_use (void); + #define ggc_alloc_rtvec_sized(NELT) \ (rtvec_def *) ggc_internal_alloc (sizeof (struct rtvec_def) \ + ((NELT) - 1) * sizeof (rtx)) \