OSDN Git Service

* config/spu/spu-protos.c (spu_split_address): Add.
[pf3gnuchains/gcc-fork.git] / gcc / ggc-common.c
index 7112f78..3cafc77 100644 (file)
@@ -1,5 +1,5 @@
 /* Simple garbage collection for the GNU compiler.
-   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+   Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
 
 This file is part of GCC.
@@ -16,8 +16,8 @@ for more details.
 
 You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING.  If not, write to the Free
-Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.  */
+Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA
+02110-1301, USA.  */
 
 /* Generic garbage collection (GC) functions and data, not specific to
    any particular GC implementation.  */
@@ -468,7 +468,7 @@ gt_pch_save (FILE *f)
       
   ggc_pch_this_base (state.d, mmi.preferred_base);
 
-  state.ptrs = xmalloc (state.count * sizeof (*state.ptrs));
+  state.ptrs = XNEWVEC (struct ptr_data *, state.count);
   state.ptrs_i = 0;
   htab_traverse (saving_htab, call_alloc, &state);
   qsort (state.ptrs, state.count, sizeof (*state.ptrs), compare_ptr_data);
@@ -751,10 +751,10 @@ ggc_min_heapsize_heuristic (void)
 # endif
 
   /* Don't blindly run over our data limit; do GC at least when the
-     *next* GC would be within 16Mb of the limit.  If GCC does hit the
-     data limit, compilation will fail, so this tries to be
-     conservative.  */
-  limit_kbytes = MAX (0, limit_kbytes - 16 * 1024);
+     *next* GC would be within 20Mb of the limit or within a quarter of
+     the limit, whichever is larger.  If GCC does hit the data limit,
+     compilation will fail, so this tries to be conservative.  */
+  limit_kbytes = MAX (0, limit_kbytes - MAX (limit_kbytes / 4, 20 * 1024));
   limit_kbytes = (limit_kbytes * 100) / (110 + ggc_min_expand_heuristic());
   phys_kbytes = MIN (phys_kbytes, limit_kbytes);
 
@@ -865,7 +865,7 @@ ggc_record_overhead (size_t allocated, size_t overhead, void *ptr,
                     const char *name, int line, const char *function)
 {
   struct loc_descriptor *loc = loc_descriptor (name, line, function);
-  struct ptr_hash_entry *p = xmalloc (sizeof (struct ptr_hash_entry));
+  struct ptr_hash_entry *p = XNEW (struct ptr_hash_entry);
   PTR *slot;
 
   p->ptr = ptr;
@@ -906,7 +906,8 @@ ggc_prune_overhead_list (void)
 }
 
 /* Notice that the pointer has been freed.  */
-void ggc_free_overhead (void *ptr)
+void
+ggc_free_overhead (void *ptr)
 {
   PTR *slot = htab_find_slot_with_hash (ptr_hash, ptr, htab_hash_pointer (ptr),
                                        NO_INSERT);
@@ -939,7 +940,8 @@ add_statistics (void **slot, void *b)
 
 /* Dump per-site memory statistics.  */
 #endif
-void dump_ggc_loc_statistics (void)
+void
+dump_ggc_loc_statistics (void)
 {
 #ifdef GATHER_STATISTICS
   int nentries = 0;