aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorFrank Denis <124872+jedisct1@users.noreply.github.com>2022-12-09 18:22:50 +0100
committerGitHub <noreply@github.com>2022-12-09 18:22:50 +0100
commitc49e4d534fb8e8ec994a8ffbc62eae8ef1e4e819 (patch)
tree0194dab2137336a88964fc781f62ea3aa8f0bef0 /doc
parent65f35a76f954c30717f641fde341771085abd06e (diff)
downloadzig-c49e4d534fb8e8ec994a8ffbc62eae8ef1e4e819.tar.gz
zig-c49e4d534fb8e8ec994a8ffbc62eae8ef1e4e819.zip
Improve and remove duplicate doNotOptimizeAway() implementations (#13790)
* Improve and remove duplicate doNotOptimizeAway() implementations We currently have two doNotOptimizeAway() implementations, one in std.math and the other one in std.mem. Maybe we should deprecate one. In the meantime, the std.math one now just calls the std.mem one. In a comptime environment, just ignore the value. Previously, std.mem.doNotOptimizeAway() did not work at comptime. If the value fits in a CPU register, just tell the compiler we need that value to be computed, without clobbering anything else. Only clobber all possibly escaped memory on pointers or large arrays. Add tests by the way since we didn't had any (we had, but only indirect ones).
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions