From 9acc7238db25f229ea9bbf8d9c888c0520c538a6 Mon Sep 17 00:00:00 2001 From: rth Date: Sat, 13 Jan 2001 19:58:43 +0000 Subject: * 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 --- gcc/ggc-page.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'gcc/ggc-page.c') 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; } -- cgit v1.2.1