| ... | @@ -7840,9 +7840,8 @@ fn readFile(allocator: Allocator, filename: []const u8) ![]u8 { | ... | @@ -7840,9 +7840,8 @@ fn readFile(allocator: Allocator, filename: []const u8) ![]u8 { |
| 7840 | {#header_open|@alignCast#} | 7840 | {#header_open|@alignCast#} |
| 7841 | <pre>{#syntax#}@alignCast(comptime alignment: u29, ptr: anytype) anytype{#endsyntax#}</pre> | 7841 | <pre>{#syntax#}@alignCast(comptime alignment: u29, ptr: anytype) anytype{#endsyntax#}</pre> |
| 7842 | <p> | 7842 | <p> |
| 7843 | {#syntax#}ptr{#endsyntax#} can be {#syntax#}*T{#endsyntax#}, {#syntax#}fn(){#endsyntax#}, {#syntax#}?*T{#endsyntax#}, | 7843 | {#syntax#}ptr{#endsyntax#} can be {#syntax#}*T{#endsyntax#}, {#syntax#}?*T{#endsyntax#}, or {#syntax#}[]T{#endsyntax#}. |
| 7844 | {#syntax#}?fn(){#endsyntax#}, or {#syntax#}[]T{#endsyntax#}. It returns the same type as {#syntax#}ptr{#endsyntax#} | 7844 | It returns the same type as {#syntax#}ptr{#endsyntax#} except with the alignment adjusted to the new value. |
| 7845 | except with the alignment adjusted to the new value. | | |
| 7846 | </p> | 7845 | </p> |
| 7847 | <p>A {#link|pointer alignment safety check|Incorrect Pointer Alignment#} is added | 7846 | <p>A {#link|pointer alignment safety check|Incorrect Pointer Alignment#} is added |
| 7848 | to the generated code to make sure the pointer is aligned as promised.</p> | 7847 | to the generated code to make sure the pointer is aligned as promised.</p> |
| ... | @@ -9066,14 +9065,9 @@ pub const PrefetchOptions = struct { | ... | @@ -9066,14 +9065,9 @@ pub const PrefetchOptions = struct { |
| 9066 | {#header_open|@ptrToInt#} | 9065 | {#header_open|@ptrToInt#} |
| 9067 | <pre>{#syntax#}@ptrToInt(value: anytype) usize{#endsyntax#}</pre> | 9066 | <pre>{#syntax#}@ptrToInt(value: anytype) usize{#endsyntax#}</pre> |
| 9068 | <p> | 9067 | <p> |
| 9069 | Converts {#syntax#}value{#endsyntax#} to a {#syntax#}usize{#endsyntax#} which is the address of the pointer. {#syntax#}value{#endsyntax#} can be one of these types: | 9068 | Converts {#syntax#}value{#endsyntax#} to a {#syntax#}usize{#endsyntax#} which is the address of the pointer. |
| | 9069 | {#syntax#}value{#endsyntax#} can be {#syntax#}*T{#endsyntax#} or {#syntax#}?*T{#endsyntax#}. |
| 9070 | </p> | 9070 | </p> |
| 9071 | <ul> | | |
| 9072 | <li>{#syntax#}*T{#endsyntax#}</li> | | |
| 9073 | <li>{#syntax#}?*T{#endsyntax#}</li> | | |
| 9074 | <li>{#syntax#}fn(){#endsyntax#}</li> | | |
| 9075 | <li>{#syntax#}?fn(){#endsyntax#}</li> | | |
| 9076 | </ul> | | |
| 9077 | <p>To convert the other way, use {#link|@intToPtr#}</p> | 9071 | <p>To convert the other way, use {#link|@intToPtr#}</p> |
| 9078 | | 9072 | |
| 9079 | {#header_close#} | 9073 | {#header_close#} |