Zig 0.17.0-dev (Split by item)

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 library itself.

posix_memalign

malloc.posix_memalign
fn posix_memalign(result: *?[*]align(alignment_bytes) u8, alloc_alignment: usize, n: usize) callconv(.c) c_int

File

lib/c/malloc.zig:185

Code

fn posix_memalign(result: *?[*]align(alignment_bytes) u8, alloc_alignment: usize, n: usize) callconv(.c) c_int {
    if (alloc_alignment < @sizeOf(*anyopaque)) return @backingInt(std.c.E.INVAL);
    result.* = aligned_alloc_inner(alloc_alignment, n) orelse return @backingInt(std.c.E.NOMEM);
    return 0;
}