Mercurial > hg > CbC > CbC_gcc
diff gcc/ggc-zone.c @ 55:77e2b8dfacca gcc-4.4.5
update it from 4.4.3 to 4.5.0
author | ryoma <e075725@ie.u-ryukyu.ac.jp> |
---|---|
date | Fri, 12 Feb 2010 23:39:51 +0900 |
parents | a06113de4d67 |
children | b7f97abdc517 |
line wrap: on
line diff
--- a/gcc/ggc-zone.c Sun Feb 07 18:28:00 2010 +0900 +++ b/gcc/ggc-zone.c Fri Feb 12 23:39:51 2010 +0900 @@ -36,6 +36,7 @@ #include "timevar.h" #include "params.h" #include "bitmap.h" +#include "plugin.h" /* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a file open. Prefer either to valloc. */ @@ -425,13 +426,13 @@ /* Total allocations and overhead for sizes less than 32, 64 and 128. These sizes are interesting because they are typical cache line sizes. */ - + unsigned long long total_allocated_under32; unsigned long long total_overhead_under32; - + unsigned long long total_allocated_under64; unsigned long long total_overhead_under64; - + unsigned long long total_allocated_under128; unsigned long long total_overhead_under128; } stats; @@ -1314,7 +1315,7 @@ /* Keep track of how many bytes are being allocated. This information is used in deciding when to collect. */ zone->allocated += size; - + timevar_ggc_mem_total += size; #ifdef GATHER_STATISTICS @@ -1520,7 +1521,7 @@ offset = (ptr - pch_zone.page) / BYTES_PER_MARK_BIT; mark_word = offset / (8 * sizeof (mark_type)); mark_bit = offset % (8 * sizeof (mark_type)); - + if (pch_zone.mark_bits[mark_word] & (1 << mark_bit)) return 1; pch_zone.mark_bits[mark_word] |= (1 << mark_bit); @@ -1570,7 +1571,7 @@ offset = (ptr - pch_zone.page) / BYTES_PER_MARK_BIT; mark_word = offset / (8 * sizeof (mark_type)); mark_bit = offset % (8 * sizeof (mark_type)); - + return (pch_zone.mark_bits[mark_word] & (1 << mark_bit)) != 0; } @@ -1962,7 +1963,7 @@ ggc_prune_overhead_list (); #endif } - + sweep_pages (zone); zone->was_collected = true; zone->allocated_last_gc = zone->allocated; @@ -2029,6 +2030,8 @@ } } + invoke_plugin_callbacks (PLUGIN_GGC_START, NULL); + /* Start by possibly collecting the main zone. */ main_zone.was_collected = false; marked |= ggc_collect_1 (&main_zone, true); @@ -2093,6 +2096,8 @@ } } + invoke_plugin_callbacks (PLUGIN_GGC_END, NULL); + timevar_pop (TV_GC); } @@ -2173,7 +2178,7 @@ chunk = chunk->next_free; } } - + fprintf (stderr, "%20s %10lu%c %10lu%c %10lu%c\n", zone->name, SCALE (allocated), LABEL (allocated), @@ -2216,7 +2221,7 @@ SCALE (total_allocated), LABEL(total_allocated), SCALE (total_overhead), LABEL (total_overhead)); -#ifdef GATHER_STATISTICS +#ifdef GATHER_STATISTICS { unsigned long long all_overhead = 0, all_allocated = 0; unsigned long long all_overhead_under32 = 0, all_allocated_under32 = 0; @@ -2235,7 +2240,7 @@ all_allocated_under64 += zone->stats.total_allocated_under64; all_overhead_under64 += zone->stats.total_overhead_under64; - + all_allocated_under128 += zone->stats.total_allocated_under128; all_overhead_under128 += zone->stats.total_overhead_under128;