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

Side by Side Diff: base/process/memory_win.cc

Issue 55333002: Make possible to check memory allocations inside chromium (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/process/memory.h" 5 #include "base/process/memory.h"
6 6
7 #include <psapi.h> 7 #include <psapi.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 HMODULE instance = NULL; 75 HMODULE instance = NULL;
76 if (!::GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | 76 if (!::GetModuleHandleExA(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS |
77 GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, 77 GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT,
78 static_cast<char*>(address), 78 static_cast<char*>(address),
79 &instance)) { 79 &instance)) {
80 NOTREACHED(); 80 NOTREACHED();
81 } 81 }
82 return instance; 82 return instance;
83 } 83 }
84 84
85 #if defined(WIN_USE_ALLOCATOR_SHIM)
86 void allocator_shim_try_malloc(size_t) __THROW;
87 #endif
88
89 void* UncheckedMalloc(size_t size) {
90 #if defined(WIN_USE_ALLOCATOR_SHIM)
91 return allocator_shim_try_malloc(size);
92 #else
93 return malloc(size);
94 #endif
95 }
96
85 } // namespace base 97 } // namespace base
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698