OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "tools/memory_watcher/call_stack.h" | 5 #include "tools/memory_watcher/call_stack.h" |
6 | 6 |
7 #include <shlwapi.h> | 7 #include <shlwapi.h> |
8 #include <tlhelp32.h> | 8 #include <tlhelp32.h> |
9 | 9 |
10 #include "base/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "tools/memory_watcher/memory_hook.h" | 11 #include "tools/memory_watcher/memory_hook.h" |
12 | 12 |
13 // Typedefs for explicit dynamic linking with functions exported from | 13 // Typedefs for explicit dynamic linking with functions exported from |
14 // dbghelp.dll. | 14 // dbghelp.dll. |
15 typedef BOOL (__stdcall *t_StackWalk64)(DWORD, HANDLE, HANDLE, | 15 typedef BOOL (__stdcall *t_StackWalk64)(DWORD, HANDLE, HANDLE, |
16 LPSTACKFRAME64, PVOID, | 16 LPSTACKFRAME64, PVOID, |
17 PREAD_PROCESS_MEMORY_ROUTINE64, | 17 PREAD_PROCESS_MEMORY_ROUTINE64, |
18 PFUNCTION_TABLE_ACCESS_ROUTINE64, | 18 PFUNCTION_TABLE_ACCESS_ROUTINE64, |
19 PGET_MODULE_BASE_ROUTINE64, | 19 PGET_MODULE_BASE_ROUTINE64, |
20 PTRANSLATE_ADDRESS_ROUTINE64); | 20 PTRANSLATE_ADDRESS_ROUTINE64); |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 return MemoryHook::Alloc(size); | 390 return MemoryHook::Alloc(size); |
391 } | 391 } |
392 | 392 |
393 void AllocationStack::operator delete(void* ptr) { | 393 void AllocationStack::operator delete(void* ptr) { |
394 AllocationStack *stack = reinterpret_cast<AllocationStack*>(ptr); | 394 AllocationStack *stack = reinterpret_cast<AllocationStack*>(ptr); |
395 base::AutoLock lock(freelist_lock_); | 395 base::AutoLock lock(freelist_lock_); |
396 DCHECK(stack->next_ == NULL); | 396 DCHECK(stack->next_ == NULL); |
397 stack->next_ = freelist_; | 397 stack->next_ = freelist_; |
398 freelist_ = stack; | 398 freelist_ = stack; |
399 } | 399 } |
OLD | NEW |