From 6281a511e130aeb4f7c777de9b90c60d7c8c6f34 Mon Sep 17 00:00:00 2001
From: Andrew Kelley @inlineCall guarantees that the call
will be inlined. If the call cannot be inlined, a compile error is emitted.
See also:
+@intToPtr(comptime DestType: type, int: usize) -> DestType
@@ -4574,6 +4579,25 @@ mem.set(u8, dest, c);
stores the overflowed bits in result and returns true.
If no overflow or underflow occurs, returns false.
@noInlineCall(function: var, args: ...) -> var
+ + This calls a function, in the same way that invoking an expression with parentheses does: +
+const assert = @import("std").debug.assert;
+test "noinline function call" {
+ assert(@noInlineCall(add, 3, 9) == 12);
+}
+
+fn add(a: i32, b: i32) -> i32 { a + b }
+
+ 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:
+@offsetOf(comptime T: type, comptime field_name: [] const u8) -> (number literal)