ggc-page.c (ggc_collect): Avoid overflow computing min_expand.
authorGeoffrey Keating <geoffk@apple.com>
Fri, 10 Jan 2003 22:32:00 +0000 (22:32 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Fri, 10 Jan 2003 22:32:00 +0000 (22:32 +0000)
* ggc-page.c (ggc_collect): Avoid overflow computing
min_expand.

From-SVN: r61172

gcc/ChangeLog
gcc/ggc-page.c

index 29a0278666b7b4ad1300ed427b08106b32741714..935a12c0d19398f312b33535880f42d95194fd8d 100644 (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.
index a150c5a88e651657d7fc1406b91b3440e7c164a2..4898f074ee1f6598a3208b9dc7aaec53965accb3 100644 (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;