Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: base/tracked_objects.cc

Issue 12951003: Annotate ThreadData::PushToHeadOfList for MemorySanitizer. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: . Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/compiler_specific.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/tracked_objects.h" 5 #include "base/tracked_objects.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include "base/compiler_specific.h"
10 #include "base/format_macros.h" 11 #include "base/format_macros.h"
11 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
12 #include "base/process_util.h" 13 #include "base/process_util.h"
13 #include "base/profiler/alternate_timer.h" 14 #include "base/profiler/alternate_timer.h"
14 #include "base/stringprintf.h" 15 #include "base/stringprintf.h"
15 #include "base/third_party/valgrind/memcheck.h" 16 #include "base/third_party/valgrind/memcheck.h"
16 #include "base/threading/thread_restrictions.h" 17 #include "base/threading/thread_restrictions.h"
17 #include "base/port.h" 18 #include "base/port.h"
18 19
19 using base::TimeDelta; 20 using base::TimeDelta;
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 base::StringAppendF(&thread_name_, "WorkerThread-%d", thread_number); 252 base::StringAppendF(&thread_name_, "WorkerThread-%d", thread_number);
252 PushToHeadOfList(); // Which sets real incarnation_count_for_pool_. 253 PushToHeadOfList(); // Which sets real incarnation_count_for_pool_.
253 } 254 }
254 255
255 ThreadData::~ThreadData() {} 256 ThreadData::~ThreadData() {}
256 257
257 void ThreadData::PushToHeadOfList() { 258 void ThreadData::PushToHeadOfList() {
258 // Toss in a hint of randomness (atop the uniniitalized value). 259 // Toss in a hint of randomness (atop the uniniitalized value).
259 (void)VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE(&random_number_, 260 (void)VALGRIND_MAKE_MEM_DEFINED_IF_ADDRESSABLE(&random_number_,
260 sizeof(random_number_)); 261 sizeof(random_number_));
262 MSAN_UNPOISON(&random_number_, sizeof(random_number_));
261 random_number_ += static_cast<int32>(this - static_cast<ThreadData*>(0)); 263 random_number_ += static_cast<int32>(this - static_cast<ThreadData*>(0));
262 random_number_ ^= (Now() - TrackedTime()).InMilliseconds(); 264 random_number_ ^= (Now() - TrackedTime()).InMilliseconds();
263 265
264 DCHECK(!next_); 266 DCHECK(!next_);
265 base::AutoLock lock(*list_lock_.Pointer()); 267 base::AutoLock lock(*list_lock_.Pointer());
266 incarnation_count_for_pool_ = incarnation_counter_; 268 incarnation_count_for_pool_ = incarnation_counter_;
267 next_ = all_thread_data_list_head_; 269 next_ = all_thread_data_list_head_;
268 all_thread_data_list_head_ = this; 270 all_thread_data_list_head_ = this;
269 } 271 }
270 272
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after
861 : process_id(base::GetCurrentProcId()) { 863 : process_id(base::GetCurrentProcId()) {
862 #else 864 #else
863 : process_id(0) { 865 : process_id(0) {
864 #endif 866 #endif
865 } 867 }
866 868
867 ProcessDataSnapshot::~ProcessDataSnapshot() { 869 ProcessDataSnapshot::~ProcessDataSnapshot() {
868 } 870 }
869 871
870 } // namespace tracked_objects 872 } // namespace tracked_objects
OLDNEW
« no previous file with comments | « base/compiler_specific.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698