aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Weigand <uweigand@de.ibm.com>2003-06-27 17:36:21 +0000
committerUlrich Weigand <uweigand@gcc.gnu.org>2003-06-27 17:36:21 +0000
commit75d75435b640d134ed3b195e1d3b068bbf1fc6ba (patch)
tree2be831b2628a512fdac1b99d168c8e273c5f80f3
parent07d1940e1c7592fc5e3315493b2f8db9a591cfb8 (diff)
downloadgcc-75d75435b640d134ed3b195e1d3b068bbf1fc6ba.zip
gcc-75d75435b640d134ed3b195e1d3b068bbf1fc6ba.tar.gz
gcc-75d75435b640d134ed3b195e1d3b068bbf1fc6ba.tar.bz2
ggc-page.c (inverse_table): Change type of mult to size_t.
* ggc-page.c (inverse_table): Change type of mult to size_t. (compute_inverse): Compute inverse using size_t, not unsigned int. Compute inverse also for sizes larger than half a machine page. From-SVN: r68589
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/ggc-page.c17
2 files changed, 9 insertions, 14 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index eb7aef1..a86f0a8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2003-06-13 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * ggc-page.c (inverse_table): Change type of mult to size_t.
+ (compute_inverse): Compute inverse using size_t, not unsigned int.
+ Compute inverse also for sizes larger than half a machine page.
+
Fri Jun 27 18:36:12 CEST 2003 Jan Hubicka <jh@suse.cz>
* toplev.c (rest_of_decl_compilation): Only varpoolize argument
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index 4a23d01..f6fe8cd 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -231,7 +231,7 @@ static size_t object_size_table[NUM_ORDERS];
static struct
{
- unsigned int mult;
+ size_t mult;
unsigned int shift;
}
inverse_table[NUM_ORDERS];
@@ -1219,19 +1219,8 @@ ggc_get_size (const void *p)
static void
compute_inverse (unsigned order)
{
- unsigned size, inv, e;
-
- /* There can be only one object per "page" in a bucket for sizes
- larger than half a machine page; it will always have offset zero. */
- if (OBJECT_SIZE (order) > G.pagesize/2)
- {
- if (OBJECTS_PER_PAGE (order) != 1)
- abort ();
-
- DIV_MULT (order) = 1;
- DIV_SHIFT (order) = 0;
- return;
- }
+ size_t size, inv;
+ unsigned int e;
size = OBJECT_SIZE (order);
e = 0;