Skip to main content

padding_span

Function padding_span 

Source
pub fn padding_span(len: usize, alignment: usize) -> Option<usize>
Expand description

On-disk size of the padding record needed to bring len up to an alignment boundary, or None when len is already aligned.

A gap narrower than a record header cannot hold one, so the span is extended by a whole extra block. The result is always either 0 or at least MIN_PADDING_RECORD_SIZE, and len + span is always aligned.