summaryrefslogtreecommitdiffstats
path: root/struct.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-02-15 11:54:06 -0800
committerKaz Kylheku <kaz@kylheku.com>2019-02-15 11:54:06 -0800
commit3a53af3b6db3821fc614ba51c0f4ea25009a0374 (patch)
treeb0d72fddb350be541109624d11ebfde203ef0291 /struct.c
parentacb7f1a837a124488a46f0c83876e2d0ca222f24 (diff)
downloadtxr-3a53af3b6db3821fc614ba51c0f4ea25009a0374.tar.gz
txr-3a53af3b6db3821fc614ba51c0f4ea25009a0374.tar.bz2
txr-3a53af3b6db3821fc614ba51c0f4ea25009a0374.zip
structs: fix poorly maintained bitfield size.
* struct.c (struct struct_inst): When the dirty flag was added, the id field was not decreased by one bit to make space, so the desired packing is not being achieved any more. Let's just use TAG_SHIFT to reserve the maximum bits that will still let us fit a fixnum into id.
Diffstat (limited to 'struct.c')
-rw-r--r--struct.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/struct.c b/struct.c
index 5c21cf40..46f4a756 100644
--- a/struct.c
+++ b/struct.c
@@ -84,7 +84,7 @@ struct struct_type {
struct struct_inst {
struct struct_type *type;
- cnum id : sizeof (cnum) * CHAR_BIT - 1 ;
+ cnum id : sizeof (cnum) * CHAR_BIT - TAG_SHIFT;
unsigned lazy : 1;
unsigned dirty : 1;
val slot[1];