pub struct SlotManager { /* private fields */ }Expand description
Slot 管理器
Slot 管理器,可以管理和申请特定的 Slot
Implementations§
Source§impl SlotManager
impl SlotManager
Sourcepub const fn empty() -> SlotManager
pub const fn empty() -> SlotManager
创建一个空 Slot Manager,默认为没有空 Slot
随后在 SlotManager::init_empty_slots 中更新
Sourcepub const fn init_empty_slots(&mut self, new_slots: Range<usize>)
pub const fn init_empty_slots(&mut self, new_slots: Range<usize>)
初始化空的 slot 范围
一般配合 SlotManager::empty 使用
Sourcepub fn alloc_slot(&mut self) -> LeafSlot
pub fn alloc_slot(&mut self) -> LeafSlot
申请一个新的空 Slot
Sourcepub fn alloc_slots(&mut self, num: usize) -> SlotRange ⓘ
pub fn alloc_slots(&mut self, num: usize) -> SlotRange ⓘ
申请多个 slot
返回的是开始位置的 LeafSlot