diff options
author | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-04-07 00:11:43 +0000 |
---|---|---|
committer | bothner <bothner@138bc75d-0d04-0410-961f-82ee72b054a4> | 2001-04-07 00:11:43 +0000 |
commit | 0acad087c27bca064cf9435061c2a8812fb14478 (patch) | |
tree | 45fce1262c5241e4b2007ad637999e4734424ffb /boehm-gc/misc.c | |
parent | 97069331acf4684ff7fd9a8fa6ff236b15383c05 (diff) | |
download | gcc-0acad087c27bca064cf9435061c2a8812fb14478.tar.gz |
* misc.c: Back out buggy changes to stack clearing code.
Reduce CLEAR_SIZE to 1/4 of original value to reduce time
spent clearing memory.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41172 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'boehm-gc/misc.c')
-rw-r--r-- | boehm-gc/misc.c | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/boehm-gc/misc.c b/boehm-gc/misc.c index 1e1ada57457..9edb9453bb4 100644 --- a/boehm-gc/misc.c +++ b/boehm-gc/misc.c @@ -206,10 +206,10 @@ extern signed_word GC_mem_found; */ word GC_stack_last_cleared = 0; /* GC_no when we last did this */ # ifdef THREADS -# define BIG_CLEAR_SIZE 2048 /* Clear this much now and then. */ -# define SMALL_CLEAR_SIZE 256 /* Clear this much every time. */ +# define CLEAR_SIZE 512 +# else +# define CLEAR_SIZE 213 # endif -# define CLEAR_SIZE 213 /* Granularity for GC_clear_stack_inner */ # define DEGRADE_RATE 50 word GC_min_sp; /* Coolest stack pointer value from which we've */ @@ -266,12 +266,10 @@ ptr_t arg; { register word sp = (word)GC_approx_sp(); /* Hotter than actual sp */ # ifdef THREADS - word dummy[SMALL_CLEAR_SIZE]; - unsigned random_no = 0; /* Should be more random than it is ... */ - /* Used to occasionally clear a bigger */ - /* chunk. */ + word dummy[CLEAR_SIZE]; +# else + register word limit; # endif - register word limit; # define SLOP 400 /* Extra bytes we clear every time. This clears our own */ @@ -289,14 +287,7 @@ ptr_t arg; /* thus more junk remains accessible, thus the heap gets */ /* larger ... */ # ifdef THREADS - if (++random_no % 13 == 0) { - limit = sp; - MAKE_HOTTER(limit, BIG_CLEAR_SIZE*sizeof(word)); - return GC_lear_stack_inner(arg, limit); - } else { - BZERO(dummy, SMALL_CLEAR_SIZE*sizeof(word)); - return arg; - } + BZERO(dummy, CLEAR_SIZE*sizeof(word)); # else if (GC_gc_no > GC_stack_last_cleared) { /* Start things over, so we clear the entire stack again */ |