Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

alignBackwardAnyAlign

Public Function
std.mem.alignBackwardAnyAlign
pub fn alignBackwardAnyAlign(comptime T: type, addr: T, alignment: T) T

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.

Params

  • T: type
  • addr: T
  • alignment: T

File

mem.zig:4924
4924
4925
4926
4927
4928
4929
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);
}