diff options
author | Kostya Serebryany <kcc@google.com> | 2012-06-06 15:06:58 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@google.com> | 2012-06-06 15:06:58 +0000 |
commit | e0cff0bc20ae51790c8edfbceb817e18ebf5355e (patch) | |
tree | 0e436dc86933d57346efe989b672c0916b77e7c3 /lib/asan/asan_thread.h | |
parent | 7ebac9534c484b06a0c2822d83f082a127e743bc (diff) |
[asan] make tid u32 instead of int
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@158074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_thread.h')
-rw-r--r-- | lib/asan/asan_thread.h | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/asan/asan_thread.h b/lib/asan/asan_thread.h index a504b8342..4d356cc74 100644 --- a/lib/asan/asan_thread.h +++ b/lib/asan/asan_thread.h @@ -21,6 +21,8 @@ namespace __asan { +const u32 kInvalidTid = 0xffffff; // Must fit into 24 bits. + class AsanThread; // These objects are created for every thread and are never deleted, @@ -28,10 +30,10 @@ class AsanThread; class AsanThreadSummary { public: explicit AsanThreadSummary(LinkerInitialized) { } // for T0. - AsanThreadSummary(int parent_tid, AsanStackTrace *stack) + AsanThreadSummary(u32 parent_tid, AsanStackTrace *stack) : parent_tid_(parent_tid), announced_(false) { - tid_ = -1; + tid_ = kInvalidTid; if (stack) { stack_ = *stack; } @@ -45,15 +47,15 @@ class AsanThreadSummary { stack_.PrintStack(); } } - int tid() { return tid_; } - void set_tid(int tid) { tid_ = tid; } + u32 tid() { return tid_; } + void set_tid(u32 tid) { tid_ = tid; } AsanThread *thread() { return thread_; } void set_thread(AsanThread *thread) { thread_ = thread; } static void TSDDtor(void *tsd); private: - int tid_; - int parent_tid_; + u32 tid_; + u32 parent_tid_; bool announced_; AsanStackTrace stack_; AsanThread *thread_; @@ -63,7 +65,7 @@ class AsanThreadSummary { class AsanThread { public: explicit AsanThread(LinkerInitialized); // for T0. - static AsanThread *Create(int parent_tid, thread_callback_t start_routine, + static AsanThread *Create(u32 parent_tid, thread_callback_t start_routine, void *arg, AsanStackTrace *stack); void Destroy(); @@ -73,7 +75,7 @@ class AsanThread { uptr stack_top() { return stack_top_; } uptr stack_bottom() { return stack_bottom_; } uptr stack_size() { return stack_top_ - stack_bottom_; } - int tid() { return summary_->tid(); } + u32 tid() { return summary_->tid(); } AsanThreadSummary *summary() { return summary_; } void set_summary(AsanThreadSummary *summary) { summary_ = summary; } @@ -87,8 +89,6 @@ class AsanThread { AsanThreadLocalMallocStorage &malloc_storage() { return malloc_storage_; } AsanStats &stats() { return stats_; } - static const int kInvalidTid = -1; - private: void SetThreadStackTopAndBottom(); |