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

Unified Diff: base/allocator/allocator_shim.cc

Issue 55333002: Make possible to check memory allocations inside chromium (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix windows build 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 side-by-side diff with in-line comments
Download patch
Index: base/allocator/allocator_shim.cc
diff --git a/base/allocator/allocator_shim.cc b/base/allocator/allocator_shim.cc
index 9b3b50c4ee4ca82350ad2c3d2fd69a7064608fed..aacda3d248124109a832ea67b6cf071bc66f6a78 100644
--- a/base/allocator/allocator_shim.cc
+++ b/base/allocator/allocator_shim.cc
@@ -6,6 +6,7 @@
#include <config.h>
#include "base/allocator/allocator_extension_thunks.h"
+#include "base/process/memory.h"
#include "base/profiler/alternate_timer.h"
#include "base/sysinfo.h"
#include "jemalloc.h"
@@ -380,6 +381,21 @@ void _aligned_free(void* p) {
} // extern C
namespace base {
+
+bool UncheckedMalloc(size_t size, void** result) {
+ switch (::allocator) {
+ case JEMALLOC:
+ *result = je_malloc(size);
+ case WINHEAP:
+ case WINLFH:
+ *result = win_heap_malloc(size);
+ case TCMALLOC:
+ *result = do_malloc(size);
+ }
+
+ return *result;
+}
+
namespace allocator {
void SetupSubprocessAllocator() {

Powered by Google App Engine
This is Rietveld 408576698