aboutsummaryrefslogtreecommitdiff
path: root/gcc/ggc-zone.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2004-08-24 00:46:11 +0000
committerDaniel Jacobowitz <drow@gcc.gnu.org>2004-08-24 00:46:11 +0000
commitd685c974fe6ef429c0019254ed2fd65d347ceabc (patch)
tree27ff5ccbd60df69edffed8aae8d3ce5a5a79a9a5 /gcc/ggc-zone.c
parentf676971a92dcc163394d15c819e904cbed2438d6 (diff)
downloadgcc-d685c974fe6ef429c0019254ed2fd65d347ceabc.zip
gcc-d685c974fe6ef429c0019254ed2fd65d347ceabc.tar.gz
gcc-d685c974fe6ef429c0019254ed2fd65d347ceabc.tar.bz2
ggc-zone.c (struc alloc_chunk): Rearrange flag bits and SIZE.
* ggc-zone.c (struc alloc_chunk): Rearrange flag bits and SIZE. Remove TYPECODE. (ggc_alloc_zone_1): Mark TYPE as unused. Don't save it in the chunk. From-SVN: r86456
Diffstat (limited to 'gcc/ggc-zone.c')
-rw-r--r--gcc/ggc-zone.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/gcc/ggc-zone.c b/gcc/ggc-zone.c
index fc605f4..86fbc28 100644
--- a/gcc/ggc-zone.c
+++ b/gcc/ggc-zone.c
@@ -146,10 +146,13 @@ struct alloc_chunk {
unsigned int magic;
#endif
unsigned int type:1;
- unsigned int typecode:14;
- unsigned int large:1;
- unsigned int size:15;
unsigned int mark:1;
+ unsigned char large;
+ unsigned short size;
+ /* Right now, on 32-bit hosts we don't have enough room to save the
+ typecode unless we make the one remaining flag into a bitfield.
+ There's a performance cost to that, so we don't do it until we're
+ ready to use the type information for something. */
union {
struct alloc_chunk *next_free;
char data[1];
@@ -594,7 +597,8 @@ free_chunk (struct alloc_chunk *chunk, size_t size, struct alloc_zone *zone)
/* Allocate a chunk of memory of SIZE bytes. */
static void *
-ggc_alloc_zone_1 (size_t orig_size, struct alloc_zone *zone, short type
+ggc_alloc_zone_1 (size_t orig_size, struct alloc_zone *zone,
+ short type ATTRIBUTE_UNUSED
MEM_STAT_DECL)
{
size_t bin = 0;
@@ -696,7 +700,8 @@ ggc_alloc_zone_1 (size_t orig_size, struct alloc_zone *zone, short type
#endif
chunk->type = 1;
chunk->mark = 0;
- chunk->typecode = type;
+ /* We could save TYPE in the chunk, but we don't use that for
+ anything yet. */
result = chunk->u.data;
#ifdef ENABLE_GC_CHECKING