| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // MemoryWatcher. | 5 // MemoryWatcher. |
| 6 // The MemoryWatcher is a library that can be linked into any | 6 // The MemoryWatcher is a library that can be linked into any |
| 7 // win32 application. It will override the default memory allocators | 7 // win32 application. It will override the default memory allocators |
| 8 // and track call stacks for any allocations that are made. It can | 8 // and track call stacks for any allocations that are made. It can |
| 9 // then be used to see what memory is in use. | 9 // then be used to see what memory is in use. |
| 10 | 10 |
| 11 #ifndef MEMORY_WATCHER_MEMORY_WATCHER_ | 11 #ifndef TOOLS_MEMORY_WATCHER_MEMORY_WATCHER_ |
| 12 #define MEMORY_WATCHER_MEMORY_WATCHER_ | 12 #define TOOLS_MEMORY_WATCHER_MEMORY_WATCHER_ |
| 13 | 13 |
| 14 #include <map> | 14 #include <map> |
| 15 #include <functional> | 15 #include <functional> |
| 16 |
| 16 #include "base/lock.h" | 17 #include "base/lock.h" |
| 17 #include "tools/memory_watcher/memory_hook.h" | 18 #include "tools/memory_watcher/memory_hook.h" |
| 18 | 19 |
| 19 class CallStack; | 20 class CallStack; |
| 20 class AllocationStack; | 21 class AllocationStack; |
| 21 | 22 |
| 22 // The MemoryWatcher installs allocation hooks and monitors | 23 // The MemoryWatcher installs allocation hooks and monitors |
| 23 // allocations and frees. | 24 // allocations and frees. |
| 24 class MemoryWatcher : MemoryObserver { | 25 class MemoryWatcher : MemoryObserver { |
| 25 public: | 26 public: |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 // The file name for that log. | 85 // The file name for that log. |
| 85 std::string file_name_; | 86 std::string file_name_; |
| 86 | 87 |
| 87 // An optional name that appears in the log file name (used to differentiate | 88 // An optional name that appears in the log file name (used to differentiate |
| 88 // logs). | 89 // logs). |
| 89 std::string log_name_; | 90 std::string log_name_; |
| 90 }; | 91 }; |
| 91 | 92 |
| 92 | 93 |
| 93 | 94 |
| 94 #endif // MEMORY_WATCHER_ | 95 #endif // TOOLS_MEMORY_WATCHER_MEMORY_WATCHER_ |
| OLD | NEW |