summaryrefslogtreecommitdiff
path: root/allchblk.c
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2013-12-21 21:16:56 +0400
committerIvan Maidanski <ivmai@mail.ru>2013-12-21 21:16:56 +0400
commita49b495533b253ffba733c5ccf76e61442fe0c22 (patch)
tree7eaf4011026f7c0e6b45c3da18bb9e0d95549ba2 /allchblk.c
parentdff7453032eeb84a96d654dab7c77e1984e07dd2 (diff)
downloadbdwgc-a49b495533b253ffba733c5ccf76e61442fe0c22.tar.gz
Remove hb_large_block field (use 1 extra bit of hb_flags instead)
* allchblk.c (setup_header): Use (hb_flags & LARGE_BLOCK) != 0 instead of hb_large_block. * private/gc_pmark.h (PUSH_CONTENTS_HDR): Likewise. * mallocx.c (GC_realloc): Likewise. * include/private/gc_priv.h (struct hblkhdr): Remove hb_large_block; define LARGE_BLOCK to access corresponding bit in hb_flags (only if MARK_BIT_PER_GRANULE).
Diffstat (limited to 'allchblk.c')
-rw-r--r--allchblk.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/allchblk.c b/allchblk.c
index 98085b6d..8ae1f671 100644
--- a/allchblk.c
+++ b/allchblk.c
@@ -226,10 +226,12 @@ static GC_bool setup_header(hdr * hhdr, struct hblk *block, size_t byte_sz,
int kind, unsigned flags)
{
word descr;
-# ifndef MARK_BIT_PER_OBJ
+# ifdef MARK_BIT_PER_GRANULE
size_t granules;
-# endif
+ if (byte_sz > MAXOBJBYTES)
+ flags |= LARGE_BLOCK;
+# endif
# ifdef ENABLE_DISCLAIM
if (GC_obj_kinds[kind].ok_disclaim_proc)
flags |= HAS_DISCLAIM;
@@ -267,19 +269,17 @@ static GC_bool setup_header(hdr * hhdr, struct hblk *block, size_t byte_sz,
hhdr -> hb_inv_sz = inv_sz;
}
# else /* MARK_BIT_PER_GRANULE */
- hhdr -> hb_large_block = (unsigned char)(byte_sz > MAXOBJBYTES);
granules = BYTES_TO_GRANULES(byte_sz);
if (EXPECT(!GC_add_map_entry(granules), FALSE)) {
/* Make it look like a valid block. */
hhdr -> hb_sz = HBLKSIZE;
hhdr -> hb_descr = 0;
- hhdr -> hb_large_block = TRUE;
+ hhdr -> hb_flags |= LARGE_BLOCK;
hhdr -> hb_map = 0;
return FALSE;
- } else {
- size_t index = (hhdr -> hb_large_block? 0 : granules);
- hhdr -> hb_map = GC_obj_map[index];
}
+ hhdr -> hb_map = GC_obj_map[(hhdr -> hb_flags & LARGE_BLOCK) != 0 ?
+ 0 : granules];
# endif /* MARK_BIT_PER_GRANULE */
/* Clear mark bits */