diff options
author | Jan Hubicka <hubicka@ucw.cz> | 2014-05-25 04:58:54 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2014-05-25 02:58:54 +0000 |
commit | fd1e93027047ca891e278fac96d38978aeb51d6d (patch) | |
tree | 41a5b3a40274b4ea228e9edf919dd2dfac1e4e80 /gcc/ggc-page.c | |
parent | 7f7beb3f103ec602dc863ba9473bdff4337d5fff (diff) |
ggc.h (ggc_grow): New function.
* ggc.h (ggc_grow): New function.
* ggc-none.c (ggc_grow): New function.
* ggc-page.c (ggc_grow): Likewise.
* lto.c (read_cgraph_and_symbols): Grow ggc memory after streaming.
From-SVN: r210908
Diffstat (limited to 'gcc/ggc-page.c')
-rw-r--r-- | gcc/ggc-page.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c index a8d8d0ee859..e37ddc246fe 100644 --- a/gcc/ggc-page.c +++ b/gcc/ggc-page.c @@ -2185,6 +2185,23 @@ ggc_collect (void) fprintf (G.debug_file, "END COLLECTING\n"); } +/* Assume that all GGC memory is reachable and grow the limits for next collection. + With checking, trigger GGC so -Q compilation outputs how much of memory really is + reachable. */ + +void +ggc_grow (void) +{ +#ifndef ENABLE_CHECKING + G.allocated_last_gc = MAX (G.allocated_last_gc, + G.allocated); +#else + ggc_collect (); +#endif + if (!quiet_flag) + fprintf (stderr, " {GC start %luk} ", (unsigned long) G.allocated / 1024); +} + /* Print allocation statistics. */ #define SCALE(x) ((unsigned long) ((x) < 1024*10 \ ? (x) \ |