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

Side by Side Diff: base/debug/activity_tracker.cc

Issue 2578323002: Improved support for objects inside persistent memory. (Closed)
Patch Set: addressed review comments by asvitkine Created 3 years, 11 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 | « no previous file | base/feature_list.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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/debug/activity_tracker.h" 5 #include "base/debug/activity_tracker.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/debug/stack_trace.h" 9 #include "base/debug/stack_trace.h"
10 #include "base/files/file.h" 10 #include "base/files/file.h"
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 // Convert the memory block found above into an actual memory address. 1014 // Convert the memory block found above into an actual memory address.
1015 // Doing the conversion as a Header object enacts the 32/64-bit size 1015 // Doing the conversion as a Header object enacts the 32/64-bit size
1016 // consistency checks which would not otherwise be done. Unfortunately, 1016 // consistency checks which would not otherwise be done. Unfortunately,
1017 // some older compilers and MSVC don't have standard-conforming definitions 1017 // some older compilers and MSVC don't have standard-conforming definitions
1018 // of std::atomic which cause it not to be plain-old-data. Don't check on 1018 // of std::atomic which cause it not to be plain-old-data. Don't check on
1019 // those platforms assuming that the checks on other platforms will be 1019 // those platforms assuming that the checks on other platforms will be
1020 // sufficient. 1020 // sufficient.
1021 // TODO(bcwhite): Review this after major compiler releases. 1021 // TODO(bcwhite): Review this after major compiler releases.
1022 DCHECK(mem_reference); 1022 DCHECK(mem_reference);
1023 void* mem_base; 1023 void* mem_base;
1024 #if !defined(OS_WIN) && !defined(OS_ANDROID) 1024 #if 0 // TODO(bcwhite): Update this for new GetAsObject functionality.
1025 mem_base = allocator_->GetAsObject<ThreadActivityTracker::Header>( 1025 mem_base = allocator_->GetAsObject<ThreadActivityTracker::Header>(
1026 mem_reference, kTypeIdActivityTracker); 1026 mem_reference, kTypeIdActivityTracker);
1027 #else 1027 #else
1028 mem_base = allocator_->GetAsArray<char>(mem_reference, kTypeIdActivityTracker, 1028 mem_base = allocator_->GetAsArray<char>(mem_reference, kTypeIdActivityTracker,
1029 PersistentMemoryAllocator::kSizeAny); 1029 PersistentMemoryAllocator::kSizeAny);
1030 #endif 1030 #endif
1031 1031
1032 DCHECK(mem_base); 1032 DCHECK(mem_base);
1033 DCHECK_LE(stack_memory_size_, allocator_->GetAllocSize(mem_reference)); 1033 DCHECK_LE(stack_memory_size_, allocator_->GetAllocSize(mem_reference));
1034 1034
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1209 : GlobalActivityTracker::ScopedThreadActivity( 1209 : GlobalActivityTracker::ScopedThreadActivity(
1210 program_counter, 1210 program_counter,
1211 nullptr, 1211 nullptr,
1212 Activity::ACT_PROCESS_WAIT, 1212 Activity::ACT_PROCESS_WAIT,
1213 ActivityData::ForProcess(process->Pid()), 1213 ActivityData::ForProcess(process->Pid()),
1214 /*lock_allowed=*/true) {} 1214 /*lock_allowed=*/true) {}
1215 #endif 1215 #endif
1216 1216
1217 } // namespace debug 1217 } // namespace debug
1218 } // namespace base 1218 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | base/feature_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698