Index: base/process_util.h |
diff --git a/base/process_util.h b/base/process_util.h |
index 25d24202272c9cb3413a61db2658e75da2ba6d32..2a7aae2d0be1b8d53afc2ed2cb9d988e34f09013 100644 |
--- a/base/process_util.h |
+++ b/base/process_util.h |
@@ -831,11 +831,6 @@ BASE_EXPORT void EnableTerminationOnHeapCorruption(); |
// Turns on process termination if memory runs out. |
BASE_EXPORT void EnableTerminationOnOutOfMemory(); |
-#if defined(OS_MACOSX) |
-// Exposed for testing. |
-BASE_EXPORT malloc_zone_t* GetPurgeableZone(); |
-#endif // defined(OS_MACOSX) |
- |
// Enables stack dump to console output on exception and signals. |
// When enabled, the process will quit immediately. This is meant to be used in |
// unit_tests only! This is not thread-safe: only call from main thread. |
@@ -856,6 +851,20 @@ BASE_EXPORT void RaiseProcessToHighPriority(); |
void RestoreDefaultExceptionHandler(); |
#endif // defined(OS_MACOSX) |
+#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. |
+// |
+// TODO(shess): Weird place to put it, but this is where the OOM |
+// killer currently lives. |
+BASE_EXPORT void* unchecked_malloc(size_t size); |
Robert Sesek
2012/09/13 23:18:15
I only wonder if this should be named UncheckedMal
Mark Mentovai
2012/09/17 18:28:11
UncheckedMalloc.
Or UnsafeUncheckedMalloc.
|
+#endif // defined(OS_MACOSX) |
+ |
} // namespace base |
#endif // BASE_PROCESS_UTIL_H_ |