about summary refs log tree commit diff
path: root/compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-04-27 21:34:14 +0200
committerGitHub <noreply@github.com>2023-04-27 21:34:14 +0200
commit214894275722249e434d24507771b6fef789df55 (patch)
tree53ef944a48fa06dcbee2670ba28364ea6c271495 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp
parentaa22867caf32ee63a0bf7d626225e142a2129ca4 (diff)
parent7b9f64475ed51fbf8221ecb8c7f4fc9e71fa1d53 (diff)
downloadrust-214894275722249e434d24507771b6fef789df55.tar.gz
rust-214894275722249e434d24507771b6fef789df55.zip
Rollup merge of #106599 - MikailBag:patch-1, r=jyn514
Change memory ordering in System wrapper example

Currently, the `SeqCst` ordering is used, which seems unnecessary:
+ Even `Relaxed` ordering guarantees that all updates are atomic and are executed in total order
+ User code only reads atomic for monitoring purposes, no "happens-before" relationships with actual allocations and deallocations are needed for this

If argumentation above is correct, I propose changing ordering to `Relaxed` to clarify that no synchronization is required here, and improve performance (if somebody copy-pastes this example into their code).
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions