Use i8 for the bucket ages

An i8 is large enough to store all values, but requires only half the
space compared to an i16. This reduces the size of the Process type by
24 bytes.
parent ff158aae
Pipeline #39122762 failed with stages
in 8 minutes and 7 seconds
......@@ -25,13 +25,13 @@ macro_rules! lock_bucket {
}
/// The age of a bucket containing mature objects.
pub const MATURE: i16 = 100;
pub const MATURE: i8 = 125;
/// The age of a bucket containing mailbox objects.
pub const MAILBOX: i16 = 200;
pub const MAILBOX: i8 = 126;
/// The age of a bucket containing permanent objects.
pub const PERMANENT: i16 = 300;
pub const PERMANENT: i8 = 127;
/// Structure storing data of a single bucket.
pub struct Bucket {
......@@ -54,7 +54,7 @@ pub struct Bucket {
pub current_block: DerefPointer<Block>,
/// The age of the objects in the current bucket.
pub age: i16,
pub age: i8,
/// The objects in this bucket should be promoted to the mature generation.
pub promote: bool,
......@@ -68,7 +68,7 @@ impl Bucket {
Self::with_age(0)
}
pub fn with_age(age: i16) -> Self {
pub fn with_age(age: i8) -> Self {
Bucket {
blocks: BlockList::new(),
current_block: DerefPointer::null(),
......
......@@ -17,7 +17,7 @@ use object_value::ObjectValue;
use vm::state::RcState;
/// The maximum age of a bucket in the young generation.
pub const YOUNG_MAX_AGE: i16 = 3;
pub const YOUNG_MAX_AGE: i8 = 3;
/// Structure containing the state of a process-local allocator.
pub struct LocalAllocator {
......
......@@ -746,7 +746,7 @@ mod tests {
// This test is put in place to ensure the type size doesn't change
// unintentionally.
assert_eq!(size, 648);
assert_eq!(size, 624);
}
#[test]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment