OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/trace_event/malloc_dump_provider.h" | 5 #include "base/trace_event/malloc_dump_provider.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
| 9 #include "base/allocator/allocator_extension.h" |
| 10 #include "base/trace_event/process_memory_dump.h" |
| 11 #include "build/build_config.h" |
| 12 |
7 #if defined(OS_MACOSX) | 13 #if defined(OS_MACOSX) |
8 #include <malloc/malloc.h> | 14 #include <malloc/malloc.h> |
9 #else | 15 #else |
10 #include <malloc.h> | 16 #include <malloc.h> |
11 #endif | 17 #endif |
12 | 18 |
13 #include "base/allocator/allocator_extension.h" | |
14 #include "base/trace_event/process_memory_dump.h" | |
15 | |
16 namespace base { | 19 namespace base { |
17 namespace trace_event { | 20 namespace trace_event { |
18 | 21 |
19 // static | 22 // static |
20 const char MallocDumpProvider::kAllocatedObjects[] = "malloc/allocated_objects"; | 23 const char MallocDumpProvider::kAllocatedObjects[] = "malloc/allocated_objects"; |
21 | 24 |
22 // static | 25 // static |
23 MallocDumpProvider* MallocDumpProvider::GetInstance() { | 26 MallocDumpProvider* MallocDumpProvider::GetInstance() { |
24 return Singleton<MallocDumpProvider, | 27 return Singleton<MallocDumpProvider, |
25 LeakySingletonTraits<MallocDumpProvider>>::get(); | 28 LeakySingletonTraits<MallocDumpProvider>>::get(); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 other_dump->AddScalar(MemoryAllocatorDump::kNameSize, | 94 other_dump->AddScalar(MemoryAllocatorDump::kNameSize, |
92 MemoryAllocatorDump::kUnitsBytes, | 95 MemoryAllocatorDump::kUnitsBytes, |
93 resident_size - allocated_objects_size); | 96 resident_size - allocated_objects_size); |
94 } | 97 } |
95 | 98 |
96 return true; | 99 return true; |
97 } | 100 } |
98 | 101 |
99 } // namespace trace_event | 102 } // namespace trace_event |
100 } // namespace base | 103 } // namespace base |
OLD | NEW |