slab_allocator

Function get_slab_index

Source
pub fn get_slab_index(size: usize) -> usize
Expand description

根据大小获取对应的 Slab 索引

§参数

  • size: 要分配的内存大小

§返回

返回对应的 Slab 索引,如果大小超过最大 Slab 大小,则返回 Fallback 分配器的索引