summaryrefslogtreecommitdiffstats
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
commite0b9f2568ddcb5fc69e8a54c346b6f0c211782fd (patch)
treeb0d72fddb350be541109624d11ebfde203ef0291
parentadb4185fd576ebe27f3d7fc3e9992debd7cf13a0 (diff)
downloadtxr-e0b9f2568ddcb5fc69e8a54c346b6f0c211782fd.tar.gz
txr-e0b9f2568ddcb5fc69e8a54c346b6f0c211782fd.tar.bz2
txr-e0b9f2568ddcb5fc69e8a54c346b6f0c211782fd.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.
-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];