Function alignForwardAnyAlign [src]
Round an address down to the next (or current) aligned address.
Unlike alignForward, alignment can be any positive number, not just a power of 2.
Prototype
pub fn alignForwardAnyAlign(comptime T: type, addr: T, alignment: T) T
Parameters
T: type
addr: T
alignment: T
Source
pub fn alignForwardAnyAlign(comptime T: type, addr: T, alignment: T) T {
if (isValidAlignGeneric(T, alignment))
return alignForward(T, addr, alignment);
assert(alignment != 0);
return alignBackwardAnyAlign(T, addr + (alignment - 1), alignment);
}