Commit a70261ee by Richard Henderson Committed by Richard Henderson

ggc-page.c (GGC_MIN_LAST_ALLOCATED): New.

        * ggc-page.c (GGC_MIN_LAST_ALLOCATED): New.
        (init_ggc): Use it instead of a constant.
        (ggc_collect): Bound allocated_last_gc by it.

From-SVN: r29685
parent 82bd61bd
Mon Sep 27 23:03:16 1999 Richard Henderson <rth@cygnus.com>
* ggc-page.c (GGC_MIN_LAST_ALLOCATED): New.
(init_ggc): Use it instead of a constant.
(ggc_collect): Bound allocated_last_gc by it.
Mon Sep 27 19:06:04 1999 Jeffrey A Law (law@cygnus.com) Mon Sep 27 19:06:04 1999 Jeffrey A Law (law@cygnus.com)
* fixinc/fixinc.irix (stdio.h): Hack stdio.h to avoid problems * fixinc/fixinc.irix (stdio.h): Hack stdio.h to avoid problems
......
...@@ -255,6 +255,10 @@ static struct globals ...@@ -255,6 +255,10 @@ static struct globals
one) before collection is performed. */ one) before collection is performed. */
#define GGC_MIN_EXPAND_FOR_GC (1.3) #define GGC_MIN_EXPAND_FOR_GC (1.3)
/* Bound `allocated_last_gc' to 4MB, to prevent the memory expansion
test from triggering too often when the heap is small. */
#define GGC_MIN_LAST_ALLOCATED (4 * 1024 * 1024)
static page_entry *lookup_page_table_entry PROTO ((void *)); static page_entry *lookup_page_table_entry PROTO ((void *));
static void set_page_table_entry PROTO ((void *, page_entry *)); static void set_page_table_entry PROTO ((void *, page_entry *));
...@@ -724,9 +728,7 @@ init_ggc () ...@@ -724,9 +728,7 @@ init_ggc ()
G.debug_file = stdout; G.debug_file = stdout;
#endif #endif
/* Set the initial allocation to 4MB, so no collection will be G.allocated_last_gc = GGC_MIN_LAST_ALLOCATED;
performed until the heap is somewhat larger than 4 MB. */
G.allocated_last_gc = 4 * 1024 * 1024;
empty_string = ggc_alloc_string ("", 0); empty_string = ggc_alloc_string ("", 0);
ggc_add_string_root (&empty_string, 1); ggc_add_string_root (&empty_string, 1);
...@@ -1034,6 +1036,8 @@ ggc_collect () ...@@ -1034,6 +1036,8 @@ ggc_collect ()
#endif #endif
G.allocated_last_gc = G.allocated; G.allocated_last_gc = G.allocated;
if (G.allocated_last_gc < GGC_MIN_LAST_ALLOCATED)
G.allocated_last_gc = GGC_MIN_LAST_ALLOCATED;
time = get_run_time () - time; time = get_run_time () - time;
gc_time += time; gc_time += time;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment