tsan: uninline RacyStacks::operator==

It's only used during race reporting.
There is no point in polluting the main header file with it.

Reviewed By: xgupta

Differential Revision: https://reviews.llvm.org/D110470
This commit is contained in:
Dmitry Vyukov 2021-09-25 11:56:53 +02:00
parent 993f3c61b3
commit b02938439d
2 changed files with 9 additions and 7 deletions

View File

@ -274,13 +274,7 @@ class ThreadContext final : public ThreadContextBase {
struct RacyStacks {
MD5Hash hash[2];
bool operator==(const RacyStacks &other) const {
if (hash[0] == other.hash[0] && hash[1] == other.hash[1])
return true;
if (hash[0] == other.hash[1] && hash[1] == other.hash[0])
return true;
return false;
}
bool operator==(const RacyStacks &other) const;
};
struct RacyAddress {

View File

@ -670,6 +670,14 @@ bool RestoreStack(Tid tid, EventType type, Sid sid, Epoch epoch, uptr addr,
} // namespace v3
bool RacyStacks::operator==(const RacyStacks &other) const {
if (hash[0] == other.hash[0] && hash[1] == other.hash[1])
return true;
if (hash[0] == other.hash[1] && hash[1] == other.hash[0])
return true;
return false;
}
static bool FindRacyStacks(const RacyStacks &hash) {
for (uptr i = 0; i < ctx->racy_stacks.Size(); i++) {
if (hash == ctx->racy_stacks[i]) {