#allocator #page #memory #frame

no-std free-list

A free-list-based page/frame allocator

2 releases

0.3.1 May 10, 2024
0.3.0 May 8, 2024
0.2.1 Apr 23, 2019
0.1.4 Apr 10, 2019

#129 in Memory management

Download history 11/week @ 2024-02-17 4/week @ 2024-02-24 30/week @ 2024-03-30 7/week @ 2024-04-06 361/week @ 2024-05-04 185/week @ 2024-05-11

546 downloads per month

MIT/Apache

39KB
638 lines

free-list

Crates.io docs.rs CI

This crate provides the FreeList type to allocate pages/frames of virtual/physical memory:

use free_list::{FreeList, PageLayout};

let mut free_list = FreeList::<16>::new();

unsafe {
    free_list.deallocate((0x1000..0x5000).try_into().unwrap()).unwrap();
}
assert_eq!(free_list.free_space(), 0x4000);

let layout = PageLayout::from_size(0x4000).unwrap();
assert_eq!(free_list.allocate(layout).unwrap(), (0x1000..0x5000).try_into().unwrap());

For API documentation, see the docs.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~205KB