ggc-page.c (ggc_collect): Avoid overflow computing min_expand.

* ggc-page.c (ggc_collect): Avoid overflow computing
	min_expand.

From-SVN: r61172
This commit is contained in:
Geoffrey Keating 2003-01-10 22:32:00 +00:00 committed by Geoffrey Keating
parent 6dd05d08c4
commit 19cc0dd4ad
2 changed files with 5 additions and 2 deletions

View File

@ -1,5 +1,8 @@
2003-01-10 Geoffrey Keating <geoffk@apple.com>
* ggc-page.c (ggc_collect): Avoid overflow computing
min_expand.
* Makefile.in (RANLIB_FOR_TARGET): Use RANLIB when native.
(RANLIB_TEST_FOR_TARGET): Delete. Don't pass down to sub-makes.
Remove calls.

View File

@ -1509,10 +1509,10 @@ ggc_collect ()
/* Avoid frequent unnecessary work by skipping collection if the
total allocations haven't expanded much since the last
collection. */
size_t allocated_last_gc =
float allocated_last_gc =
MAX (G.allocated_last_gc, (size_t)PARAM_VALUE (GGC_MIN_HEAPSIZE) * 1024);
size_t min_expand = allocated_last_gc * PARAM_VALUE (GGC_MIN_EXPAND) / 100;
float min_expand = allocated_last_gc * PARAM_VALUE (GGC_MIN_EXPAND) / 100;
if (G.allocated < allocated_last_gc + min_expand)
return;