Skip to main content

calc_element_slot

Function calc_element_slot 

Source
pub const fn calc_element_slot(idx: usize, elem_bytes: usize) -> usize
Expand description

Calculate which slot an array element at index idx starts in.

Elements cannot span slot boundaries, so we compute how many elements fit per slot and use that to determine the slot index.