MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / round_up

Function round_up

nodedb-wal/src/align.rs:177–179  ·  view source on GitHub ↗
(value: usize, align: usize)

Source from the content-addressed store, hash-verified

175/// Round `value` up to the next multiple of `align` (which must be a power of two).
176#[inline]
177pub const fn round_up(value: usize, align: usize) -> usize {
178 (value + align - 1) & !(align - 1)
179}
180
181/// Check if a value is aligned to the given alignment.
182#[inline]

Callers 2

newMethod · 0.70
as_aligned_sliceMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected