This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PCH] Update GC statistics after load


This prevents GGC from running a collection almost immediately after a
PCH load, which is usually much better for performance...

Bootstrapped & tested on powerpc-darwin.

-- 
- Geoffrey Keating <geoffk@apple.com>

===File ~/patches/pchbranch-gcstatsupdate.patch=============
2003-01-03  Geoffrey Keating  <geoffk@apple.com>
	
	* ggc-page.c (ggc_pch_read): Update the statistics after a PCH
	load.

Index: ggc-page.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/ggc-page.c,v
retrieving revision 1.48.4.9
diff -u -p -u -p -r1.48.4.9 ggc-page.c
--- ggc-page.c	24 Dec 2002 02:06:39 -0000	1.48.4.9
+++ ggc-page.c	7 Jan 2003 01:20:17 -0000
@@ -1,5 +1,5 @@
 /* "Bag-of-pages" garbage collector for the GNU compiler.
-   Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -1833,4 +1833,7 @@ ggc_pch_read (f, addr)
 	G.pages[i] = entry;
       G.page_tails[i] = entry;
     }
+
+  /* Update the statistics.  */
+  G.allocated = G.allocated_last_gc = offs - (char *)addr;
 }
============================================================


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]