From fb9a7dad178398326033dfcddedf41b59227bc70 Mon Sep 17 00:00:00 2001 From: Robin Voetter Date: Sat, 17 Sep 2022 00:24:51 +0200 Subject: [PATCH] add @addrSpaceCast to langref --- doc/langref.html.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/doc/langref.html.in b/doc/langref.html.in index effa974f22..872c305252 100644 --- a/doc/langref.html.in +++ b/doc/langref.html.in @@ -7956,6 +7956,15 @@ fn readFile(allocator: Allocator, filename: []const u8) ![]u8 { The {#syntax#}comptime{#endsyntax#} keyword on a parameter means that the parameter must be known at compile time.

+ {#header_open|@addrSpaceCast#} +
{#syntax#}@addrSpaceCast(comptime addrspace: std.builtin.AddressSpace, ptr: anytype) anytype{#endsyntax#}
+

+ Converts a pointer from one address space to another. Depending on the current target and + address spaces, this cast may be a no-op, a complex operation, or illegal. If the cast is + legal, then the resulting pointer points to the same memory location as the pointer operand. + It is always valid to cast a pointer between the same address spaces. +

+ {#header_close#} {#header_open|@addWithOverflow#}
{#syntax#}@addWithOverflow(comptime T: type, a: T, b: T, result: *T) bool{#endsyntax#}