| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |