zig/lib/std
Frank Denis c49e4d534f
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).
2022-12-09 18:22:50 +01:00
..
atomic remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
build AstGen: make @compileError operand implicitly comptime 2022-12-07 14:48:24 +02:00
c remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
compress remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
crypto Revert "std.crypto.aes: use software implementation in comptime context (#13792)" (#13798) 2022-12-07 03:49:20 +00:00
dwarf
event remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
fmt remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
fs std: fix WASI regressions 2022-12-06 12:15:05 -07:00
hash std: re-enable auto hash test 2022-10-30 01:09:31 -07:00
heap std.ArrayList: fix shrinkAndFree 2022-11-30 15:42:59 -07:00
http std.http: fix typo 2022-10-06 21:22:20 +03:00
io std.mem.Allocator: allow shrink to fail 2022-11-29 23:30:38 -07:00
json std.json: Fix parsing of large numbers 2022-07-23 13:52:16 +03:00
math stage2: fix crash on comptime lazy @ctz and @clz 2022-11-29 23:30:38 -07:00
mem remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
meta std.mem.Allocator: allow shrink to fail 2022-11-29 23:30:38 -07:00
net
os remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
rand std.rand: make weightedIndex proportions param a const slice 2022-08-30 13:02:17 +03:00
target arm: move cpu model table into system/arm.zig 2022-11-28 17:07:35 +01:00
testing std.mem.Allocator: allow shrink to fail 2022-11-29 23:30:38 -07:00
Thread std.Thread.Futex.PosixImpl.Address.from: fix alignment type 2022-11-28 18:49:33 +02:00
time
tz
unicode
valgrind std.valgrind.callgrind: fix string type 2022-08-22 13:55:00 +03:00
x x/os/Reactor: implement remove function (#13330) 2022-11-13 17:43:29 +02:00
zig tokenizer: detect null bytes before EOF 2022-12-08 00:16:30 +02:00
array_hash_map.zig std: add move() functions to hash maps 2022-12-04 15:57:40 -07:00
array_list.zig Allow const ArrayLists to be cloned 2022-12-05 04:36:10 -05:00
ascii.zig Fix deprecation docs for isAlpha and isCntrl 2022-10-29 15:22:05 -04:00
atomic.zig all: rename i386 to x86 2022-11-04 00:09:27 +03:30
base64.zig remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
bit_set.zig std: added eql to DynamicBitSet and DynamicBitSetUnmanaged 2022-12-06 21:09:33 +02:00
bounded_array.zig AstGen: detect declarations shadowing locals 2022-08-16 20:35:03 +03:00
buf_map.zig
buf_set.zig
build.zig remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
builtin.zig remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
c.zig remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
child_process.zig std.mem.Allocator: allow shrink to fail 2022-11-29 23:30:38 -07:00
coff.zig run zig fmt on everything checked by CI 2022-11-18 19:22:42 +00:00
compress.zig
comptime_string_map.zig Re-apply: "std.ComptimeStringMap: use tuple types" 2022-12-08 22:21:46 +02:00
crypto.zig std.crypto.auth: add AEGIS MAC (#13607) 2022-11-22 18:16:04 +01:00
cstr.zig
debug.zig std.mem.Allocator: allow shrink to fail 2022-11-29 23:30:38 -07:00
dwarf.zig remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
dynamic_library.zig
elf.zig run zig fmt on everything checked by CI 2022-11-18 19:22:42 +00:00
enums.zig fix(text): hyphenate "comptime" adjectives 2022-10-05 21:19:30 +02:00
event.zig
fifo.zig
fmt.zig AstGen: make @compileError operand implicitly comptime 2022-12-07 14:48:24 +02:00
fs.zig std: fix WASI regressions 2022-12-06 12:15:05 -07:00
hash.zig
hash_map.zig std: add move() functions to hash maps 2022-12-04 15:57:40 -07:00
heap.zig add std.heap.wasm_allocator 2022-12-06 12:27:28 -07:00
http.zig
io.zig coff: compile and link simple exit program on arm64 2022-11-05 10:15:01 +01:00
json.zig remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
leb128.zig remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
linked_list.zig chore: Remove unused constants 2022-09-11 23:18:43 -04:00
log.zig std: remove deprecated API for the upcoming release 2022-09-16 14:46:53 -04:00
macho.zig run zig fmt on everything checked by CI 2022-11-18 19:22:42 +00:00
math.zig Improve and remove duplicate doNotOptimizeAway() implementations (#13790) 2022-12-09 18:22:50 +01:00
mem.zig Improve and remove duplicate doNotOptimizeAway() implementations (#13790) 2022-12-09 18:22:50 +01:00
meta.zig Re-apply: "std.ComptimeStringMap: use tuple types" 2022-12-08 22:21:46 +02:00
multi_array_list.zig remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
net.zig std.mem.Allocator: allow shrink to fail 2022-11-29 23:30:38 -07:00
once.zig
os.zig remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
packed_int_array.zig remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
pdb.zig std.mem.Allocator: allow shrink to fail 2022-11-29 23:30:38 -07:00
priority_dequeue.zig std: remove deprecated API for the upcoming release 2022-09-16 14:46:53 -04:00
priority_queue.zig std: remove deprecated API for the upcoming release 2022-09-16 14:46:53 -04:00
process.zig std: clean up imports in a couple files 2022-12-06 12:15:04 -07:00
Progress.zig Revert recent std.Progress implementation changes 2022-10-18 18:53:44 -07:00
rand.zig remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
segmented_list.zig remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
SemanticVersion.zig Make invalidFmtError public and use in place of compileErrors for bad format strings (#13526) 2022-11-12 21:03:24 +02:00
simd.zig remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
sort.zig
start.zig all: rename i386 to x86 2022-11-04 00:09:27 +03:30
start_windows_tls.zig Merge pull request #13101 from alichraghi/o4 2022-11-05 02:34:24 -04:00
std.zig
target.zig spirv: assembler 2022-11-23 19:17:58 +01:00
testing.zig std.testing: Fully absorb expectEqualBytes into expectEqualSlices 2022-12-09 04:36:27 -05:00
Thread.zig all: rename i386 to x86 2022-11-04 00:09:27 +03:30
time.zig std.time: add microTimestamp() (#13327) 2022-11-02 23:20:19 +01:00
treap.zig
tz.zig
unicode.zig remove most conditional compilation based on stage1 2022-12-06 20:38:54 -07:00
valgrind.zig LLVM: add valgrind integration for x86 and aarch64 2022-11-19 19:32:45 -07:00
wasm.zig std.wasm: add Opcode.prefixed and make PrefixedOpcode nonexhaustive 2022-12-06 12:15:04 -07:00
x.zig
zig.zig fmt: canonicalize identifiers 2022-11-18 19:22:42 +00:00