Skip to main content

calc_packed_slot_count

Function calc_packed_slot_count 

Source
pub const fn calc_packed_slot_count(n: usize, elem_bytes: usize) -> usize
Expand description

Calculate the total number of slots needed for an array.

Accounts for wasted bytes at slot ends when elements don’t divide 32 evenly.