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

Unified Diff: base/process/memory.h

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: base/process/memory.h
diff --git a/base/process/memory.h b/base/process/memory.h
index e6696cb8a708748a7b9b5724328d5f87c396f3ac..a68ac6ee0ead89ce2272beffee9f31e0cf8f6e7c 100644
--- a/base/process/memory.h
+++ b/base/process/memory.h
@@ -53,17 +53,12 @@ const int kMaxOomScore = 1000;
BASE_EXPORT bool AdjustOOMScore(ProcessId process, int score);
#endif
-#if defined(OS_MACOSX)
-// Very large images or svg canvases can cause huge mallocs. Skia
-// does tricks on tcmalloc-based systems to allow malloc to fail with
-// a NULL rather than hit the oom crasher. This replicates that for
-// OSX.
-//
-// IF YOU USE THIS WITHOUT CONSULTING YOUR FRIENDLY OSX DEVELOPER,
-// YOUR CODE IS LIKELY TO BE REVERTED. THANK YOU.
+// Special allocator functions for callers that want to check for OOM.
+// These will not abort if the allocation fails even if
+// EnableTerminationOnOutOfMemory has been called.
+// This can be useful for huge and/or unpredicteble size memory allocatios.
Ken Russell (switch to Gerrit) 2013/10/31 22:12:48 typos: unpredictable, allocations
BASE_EXPORT void* UncheckedMalloc(size_t size);
BASE_EXPORT void* UncheckedCalloc(size_t num_items, size_t size);
-#endif // defined(OS_MACOSX)
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698