[compiler-rt] [tsan] Allow unloading of ignored libraries (PR #105660)
Vitaly Buka via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 15 23:17:19 PDT 2024
================
@@ -54,20 +54,26 @@ class LibIgnore {
char *name;
char *real_name; // target of symlink
bool loaded;
+ uptr ignored_code_range_id;
};
struct LibCodeRange {
----------------
vitalybuka wrote:
Let's hide all atomic stuff in the methods and use release-acquire
```
struct LibCodeRange {
bool IsInRange(uptr pc) const {
return (pc >= begin && pc < atomic_load(&end, memory_order_acquire));
}
void OnLoad(uptr b, uptr e) {
begin = b;
atomic_store(&end, e, memory_order_release);
}
void OnUnload() {
atomic_store(&end, 0, memory_order_release);
}
private:
uptr begin;
// A value of 0 means the associated module was unloaded.
atomic_uintptr_t end;
};
```
https://github.com/llvm/llvm-project/pull/105660
More information about the llvm-commits
mailing list