aboutsummaryrefslogtreecommitdiff
path: root/src/codegen/c/Type.zig
diff options
context:
space:
mode:
authorkcbanner <kcbanner@gmail.com>2024-07-13 17:46:24 -0400
committerkcbanner <kcbanner@gmail.com>2024-07-13 17:46:24 -0400
commitbc28454b43b717dee47cf8c1a1abfb7e8ad09a1e (patch)
tree5b451406f50bd24cf9e357a0ff2af788a1798ac5 /src/codegen/c/Type.zig
parent11534aa34d6e9c66081eb2918bfaacbb21db0e56 (diff)
downloadzig-bc28454b43b717dee47cf8c1a1abfb7e8ad09a1e.tar.gz
zig-bc28454b43b717dee47cf8c1a1abfb7e8ad09a1e.zip
zig.h: replace `_InterlockedExchangeAdd` with a plain volatile load
This was causing zig2.exe to crash during bootstrap, because there was an atomic load of read-only memory, and the attempt to write to it as part of the (idempotent) atomic exchange was invalid. Aligned reads (of u32 / u64) are atomic on x86 / x64, so this is replaced with an optimization-proof load (`__iso_volatile_load8*`) and a reordering barrier.
Diffstat (limited to 'src/codegen/c/Type.zig')
0 files changed, 0 insertions, 0 deletions