summaryrefslogtreecommitdiff
path: root/gcc/ggc-page.c
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-13 19:58:43 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-13 19:58:43 +0000
commit9acc7238db25f229ea9bbf8d9c888c0520c538a6 (patch)
tree7c773f88743dffba2d709a2cbc5f4412c0794efe /gcc/ggc-page.c
parent7903ba8d45607e08baeb937efb4148d6a158ddc3 (diff)
downloadgcc-9acc7238db25f229ea9bbf8d9c888c0520c538a6.tar.gz
* ggc-page.c (alloc_page): Round up allocation size to one page.
Set e->order on extra pages. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38990 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ggc-page.c')
-rw-r--r--gcc/ggc-page.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index b5c6d57be74..fa66aa49937 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -517,6 +517,8 @@ alloc_page (order)
bitmap_size = BITMAP_SIZE (num_objects + 1);
page_entry_size = sizeof (page_entry) - sizeof (long) + bitmap_size;
entry_size = num_objects * OBJECT_SIZE (order);
+ if (entry_size < G.pagesize)
+ entry_size = G.pagesize;
entry = NULL;
page = NULL;
@@ -549,14 +551,15 @@ alloc_page (order)
struct page_entry *e, *f = G.free_pages;
int i;
- page = alloc_anon (NULL, entry_size * GGC_QUIRE_SIZE);
+ page = alloc_anon (NULL, G.pagesize * GGC_QUIRE_SIZE);
/* This loop counts down so that the chain will be in ascending
memory order. */
for (i = GGC_QUIRE_SIZE - 1; i >= 1; i--)
{
- e = (struct page_entry *) xcalloc (1, sizeof (struct page_entry));
- e->bytes = entry_size;
- e->page = page + i*entry_size;
+ e = (struct page_entry *) xcalloc (1, page_entry_size);
+ e->order = order;
+ e->bytes = G.pagesize;
+ e->page = page + (i << G.lg_pagesize);
e->next = f;
f = e;
}