mmtk 0.33.0

MMTk is a framework for the design and implementation of high-performance and portable memory managers.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use mmtk::util::Address;

#[test]
fn test_align_up() {
    let addr = unsafe { Address::zero() };
    let aligned = addr.align_up(8);

    assert_eq!(addr, aligned);
}

#[test]
fn test_is_aligned() {
    let addr = unsafe { Address::zero() };
    assert!(addr.is_aligned_to(8));

    let addr = unsafe { Address::from_usize(8) };
    assert!(addr.is_aligned_to(8));
}