Index: base/process_util.h |
diff --git a/base/process_util.h b/base/process_util.h |
index 25d24202272c9cb3413a61db2658e75da2ba6d32..5efc25cc8b0931322140fb5cec25667fbd998fbd 100644 |
--- a/base/process_util.h |
+++ b/base/process_util.h |
@@ -856,6 +856,16 @@ 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. |
+// TODO(shess): Weird place to put it, but this is where the OOM |
+// killer currently lives. |
+BASE_EXPORT void* oom_safe_malloc(size_t size); |
Avi (use Gerrit)
2012/09/13 19:45:54
I don't like the name "oom safe". While it's safe
Scott Hess - ex-Googler
2012/09/13 20:04:00
Well, it's not _unsafe_, per se. Just against gen
|
+#endif // defined(OS_MACOSX) |
+ |
} // namespace base |
#endif // BASE_PROCESS_UTIL_H_ |