Function alignBackwardAnyAlign [src]

Round an address down to the previous (or current) aligned address. Unlike alignBackward, alignment can be any positive number, not just a power of 2.

Prototype

pub fn alignBackwardAnyAlign(comptime T: type, addr: T, alignment: T) T

Parameters

T: typeaddr: Talignment: T

Source

pub fn alignBackwardAnyAlign(comptime T: type, addr: T, alignment: T) T { if (isValidAlignGeneric(T, alignment)) return alignBackward(T, addr, alignment); assert(alignment != 0); return addr - @mod(addr, alignment); }