obkrnl/uma/slab.rs
1/// Implementation of `uma_slab_head`, `uma_slab` and `uma_slab_refcnt`.
2///
3/// We use slightly different mechanism here but has the same memory layout.
4#[repr(C)]
5pub struct Slab<I: ?Sized> {
6 pub free: I, // us_freelist
7}
8
9/// Item in the slab to represents `uma_slab` structure.
10#[repr(C)]
11pub struct Free {
12 pub item: u8, // us_item
13}
14
15/// Item in the slab to represents `uma_slab_refcnt` structure.
16#[repr(C)]
17pub struct RcFree {
18 pub item: u8, // us_item
19 pub refcnt: u32, // us_refcnt
20}