Skip to content

Commit

Permalink
Move current thread data out of lsan_common on linux
Browse files Browse the repository at this point in the history
Summary:
Now that we have a platform-specific non-common lsan file, use
it to store non-common lsan data.

Reviewers: kubamracek

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D31472

llvm-svn: 299032
  • Loading branch information
fjricci committed Mar 29, 2017
1 parent 1aa2000 commit a79b8a2
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 0 additions & 4 deletions compiler-rt/lib/lsan/lsan_common_linux.cc
Original file line number Diff line number Diff line change
@@ -34,10 +34,6 @@ static bool IsLinker(const char* full_name) {
return LibraryNameIs(full_name, kLinkerName);
}

static THREADLOCAL u32 current_thread_tid = kInvalidTid;
u32 GetCurrentThread() { return current_thread_tid; }
void SetCurrentThread(u32 tid) { current_thread_tid = tid; }

__attribute__((tls_model("initial-exec")))
THREADLOCAL int disable_counter;
bool DisabledInThisThread() { return disable_counter > 0; }
4 changes: 4 additions & 0 deletions compiler-rt/lib/lsan/lsan_linux.cc
Original file line number Diff line number Diff line change
@@ -19,6 +19,10 @@

namespace __lsan {

static THREADLOCAL u32 current_thread_tid = kInvalidTid;
u32 GetCurrentThread() { return current_thread_tid; }
void SetCurrentThread(u32 tid) { current_thread_tid = tid; }

static THREADLOCAL AllocatorCache allocator_cache;
AllocatorCache *GetAllocatorCache() { return &allocator_cache; }

0 comments on commit a79b8a2

Please sign in to comment.