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

alignForwardAnyAlign

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

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.

Params

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

File

mem.zig:4800
4800
4801
4802
4803
4804
4805
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);
}