@noInlineCall

@noInlineCall

@noInlineCall(function: var, args: ...) var

This calls a function, in the same way that invoking an expression with parentheses does:

test.zig

const assert = @import("std").debug.assert;

test "noinline function call" {
    assert(@noInlineCall(add, 3, 9) == 12);
}

fn add(a: i32, b: i32) i32 {
    return a + b;
}
``` ```
$ zig test test.zig
1/1 test "noinline function call"...OK
All tests passed.

Unlike a normal function call, however, @noInlineCall guarantees that the call will not be inlined. If the call must be inlined, a compile error is emitted.

See also:

  • @inlineCall