pub fn anchor(x: usize, max: Option<usize>) -> usize
Anchor a number to a power of 2.
Useful when creating autotune keys.