Commit ca79429a by Richard Henderson Committed by Richard Henderson

ggc-page.c (alloc_page): Round up allocation size to one page.

        * ggc-page.c (alloc_page): Round up allocation size to one page.
        Set e->order on extra pages.

From-SVN: r38990
parent 2cec75a1
2001-01-13 Richard Henderson <rth@redhat.com> 2001-01-13 Richard Henderson <rth@redhat.com>
* ggc-page.c (alloc_page): Round up allocation size to one page.
Set e->order on extra pages.
2001-01-13 Richard Henderson <rth@redhat.com>
* genrecog.c (nodes_identical): Expand commentary. * genrecog.c (nodes_identical): Expand commentary.
(write_switch): Watch out for identical nodes. (write_switch): Watch out for identical nodes.
......
...@@ -517,6 +517,8 @@ alloc_page (order) ...@@ -517,6 +517,8 @@ alloc_page (order)
bitmap_size = BITMAP_SIZE (num_objects + 1); bitmap_size = BITMAP_SIZE (num_objects + 1);
page_entry_size = sizeof (page_entry) - sizeof (long) + bitmap_size; page_entry_size = sizeof (page_entry) - sizeof (long) + bitmap_size;
entry_size = num_objects * OBJECT_SIZE (order); entry_size = num_objects * OBJECT_SIZE (order);
if (entry_size < G.pagesize)
entry_size = G.pagesize;
entry = NULL; entry = NULL;
page = NULL; page = NULL;
...@@ -549,14 +551,15 @@ alloc_page (order) ...@@ -549,14 +551,15 @@ alloc_page (order)
struct page_entry *e, *f = G.free_pages; struct page_entry *e, *f = G.free_pages;
int i; 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 /* This loop counts down so that the chain will be in ascending
memory order. */ memory order. */
for (i = GGC_QUIRE_SIZE - 1; i >= 1; i--) for (i = GGC_QUIRE_SIZE - 1; i >= 1; i--)
{ {
e = (struct page_entry *) xcalloc (1, sizeof (struct page_entry)); e = (struct page_entry *) xcalloc (1, page_entry_size);
e->bytes = entry_size; e->order = order;
e->page = page + i*entry_size; e->bytes = G.pagesize;
e->page = page + (i << G.lg_pagesize);
e->next = f; e->next = f;
f = e; f = e;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment