diff options
author | Daniel Jacobowitz <dan@debian.org> | 2004-07-26 15:11:53 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@gcc.gnu.org> | 2004-07-26 15:11:53 +0000 |
commit | 02aebac6c99772f3549afc9d818ce30acbde8865 (patch) | |
tree | a48454a362fb87e31aee92eb1d395c1260433023 /gcc/ggc-zone.c | |
parent | 35b6b437aa03e95ab2eb6fa5acaf25e07a9b1433 (diff) | |
download | gcc-02aebac6c99772f3549afc9d818ce30acbde8865.zip gcc-02aebac6c99772f3549afc9d818ce30acbde8865.tar.gz gcc-02aebac6c99772f3549afc9d818ce30acbde8865.tar.bz2 |
re PR bootstrap/12804 (zone allocator is broken on 64bit)
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.
From-SVN: r85194
Diffstat (limited to 'gcc/ggc-zone.c')
-rw-r--r-- | gcc/ggc-zone.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/gcc/ggc-zone.c b/gcc/ggc-zone.c index da58116f..509ea92b 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); } |