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

Unified Diff: third_party/tcmalloc/chromium/src/tcmalloc.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, 2 months 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: third_party/tcmalloc/chromium/src/tcmalloc.cc
diff --git a/third_party/tcmalloc/chromium/src/tcmalloc.cc b/third_party/tcmalloc/chromium/src/tcmalloc.cc
index 118e40a09fdb44f2036949d4402e387817bf8cc4..9a15b585a411eb7d1dd7399a4edc23df3941a095 100644
--- a/third_party/tcmalloc/chromium/src/tcmalloc.cc
+++ b/third_party/tcmalloc/chromium/src/tcmalloc.cc
@@ -269,6 +269,11 @@ extern "C" {
// Windows: _msize()
size_t tc_malloc_size(void* p) __THROW
ATTRIBUTE_SECTION(google_malloc);
+
+ // This does not call the new handler but let the caller
+ // check whether the allocation succeed.
+ void* tc_try_malloc(size_t size) __THROW
+ ATTRIBUTE_SECTION(google_malloc);
} // extern "C"
@@ -1705,6 +1710,10 @@ extern "C" PERFTOOLS_DLL_DECL void tc_malloc_stats(void) __THROW {
do_malloc_stats();
}
+extern "C" PERFTOOLS_DLL_DECL void* tc_try_malloc(size_t size) __THROW {
+ return do_malloc(size);
+}
+
extern "C" PERFTOOLS_DLL_DECL int tc_mallopt(int cmd, int value) __THROW {
return do_mallopt(cmd, value);
}
« base/process/memory_linux.cc ('K') | « third_party/tcmalloc/chromium/src/debugallocation.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698