Nobody should be using volatile
for anything except memory-mapped I/O.
This is in the language reference:
Note that
volatile
is unrelated to concurrency and Atomics. If you see code that is usingvolatile
for something other than Memory Mapped Input/Output, it is probably a bug.
Volatile is unrelated to benchmarking an “is digit” function. There is already enough confusion in the wild about volatile. Please don’t spread it among the Zig community.
I’ll say it again: do not use volatile
for anything except MMIO.