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.

copyLessThan16

memmove.copyLessThan16
inline fn copyLessThan16(
    dest: [*]u8,
    src: [*]const u8,
    len: usize,
) void

File

lib/compiler_rt/memmove.zig:77

Code

inline fn copyLessThan16(
    dest: [*]u8,
    src: [*]const u8,
    len: usize,
) void {
    @setRuntimeSafety(compiler_rt.test_safety);
    if (len < 4) {
        if (len == 0) return;
        const b = len / 2;
        const d0 = src[0];
        const db = src[b];
        const de = src[len - 1];
        dest[0] = d0;
        dest[b] = db;
        dest[len - 1] = de;
        return;
    }
    copyRange4(4, dest, src, len);
}