From 3a53af3b6db3821fc614ba51c0f4ea25009a0374 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 15 Feb 2019 11:54:06 -0800 Subject: 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. --- struct.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'struct.c') 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]; -- cgit v1.2.3