From 1c834f33d12884aae25cabe3201d9f5f66826840 Mon Sep 17 00:00:00 2001 From: drow Date: Mon, 26 Jul 2004 15:11:53 +0000 Subject: [PATCH] PR bootstrap/12804 * ggc-zone.c (struct alloc_chunk): Remove attribute packed. (MAX_FREE_BIN_SIZE): Increase on 64-bit targets. (ggc_free): Remove incorrect freeing. (sweep_pages): Advance PP for large pages. Fix indentation. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@85194 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 8 ++++++++ gcc/ggc-zone.c | 13 +++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 87eb2754359..3763470caa5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2004-07-26 Daniel Jacobowitz + + PR bootstrap/12804 + * ggc-zone.c (struct alloc_chunk): Remove attribute packed. + (MAX_FREE_BIN_SIZE): Increase on 64-bit targets. + (ggc_free): Remove incorrect freeing. + (sweep_pages): Advance PP for large pages. Fix indentation. + 2004-07-26 Richard Sandiford PR rtl-optimization/16643 diff --git a/gcc/ggc-zone.c b/gcc/ggc-zone.c index da58116fabb..509ea92bd5b 100644 --- a/gcc/ggc-zone.c +++ b/gcc/ggc-zone.c @@ -162,7 +162,7 @@ struct alloc_chunk { double align_d; #endif } u; -} __attribute__ ((packed)); +}; #define CHUNK_OVERHEAD (offsetof (struct alloc_chunk, u)) @@ -177,7 +177,7 @@ struct alloc_chunk { on a PowerPC G4 7450 - 667 mhz, and a Pentium 4 - 2.8ghz, these were determined to be the optimal values. */ #define NUM_FREE_BINS 64 -#define MAX_FREE_BIN_SIZE 256 +#define MAX_FREE_BIN_SIZE (64 * sizeof (void *)) #define FREE_BIN_DELTA (MAX_FREE_BIN_SIZE / NUM_FREE_BINS) #define SIZE_BIN_UP(SIZE) (((SIZE) + FREE_BIN_DELTA - 1) / FREE_BIN_DELTA) #define SIZE_BIN_DOWN(SIZE) ((SIZE) / FREE_BIN_DELTA) @@ -761,10 +761,6 @@ ggc_free (void *p) /* Poison the chunk. */ poison_chunk (chunk, ggc_get_size (p)); - - /* XXX: We only deal with explicitly freeing large objects ATM. */ - if (chunk->large) - free (p); } /* If P is not marked, mark it and return false. Otherwise return true. @@ -990,13 +986,14 @@ sweep_pages (struct alloc_zone *zone) if (((struct alloc_chunk *)p->page)->mark == 1) { ((struct alloc_chunk *)p->page)->mark = 0; + pp = &p->next; } else { *pp = next; #ifdef ENABLE_GC_CHECKING - /* Poison the page. */ - memset (p->page, 0xb5, p->bytes); + /* Poison the page. */ + memset (p->page, 0xb5, p->bytes); #endif free_page (p); } -- 2.11.4.GIT