OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file/namespace contains utility functions for enumerating, ending and | 5 // This file/namespace contains utility functions for enumerating, ending and |
6 // computing statistics of processes. | 6 // computing statistics of processes. |
7 | 7 |
8 #ifndef BASE_PROCESS_UTIL_H_ | 8 #ifndef BASE_PROCESS_UTIL_H_ |
9 #define BASE_PROCESS_UTIL_H_ | 9 #define BASE_PROCESS_UTIL_H_ |
10 | 10 |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
849 // Restore the default exception handler, setting it to Apple Crash Reporter | 849 // Restore the default exception handler, setting it to Apple Crash Reporter |
850 // (ReportCrash). When forking and execing a new process, the child will | 850 // (ReportCrash). When forking and execing a new process, the child will |
851 // inherit the parent's exception ports, which may be set to the Breakpad | 851 // inherit the parent's exception ports, which may be set to the Breakpad |
852 // instance running inside the parent. The parent's Breakpad instance should | 852 // instance running inside the parent. The parent's Breakpad instance should |
853 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler | 853 // not handle the child's exceptions. Calling RestoreDefaultExceptionHandler |
854 // in the child after forking will restore the standard exception handler. | 854 // in the child after forking will restore the standard exception handler. |
855 // See http://crbug.com/20371/ for more details. | 855 // See http://crbug.com/20371/ for more details. |
856 void RestoreDefaultExceptionHandler(); | 856 void RestoreDefaultExceptionHandler(); |
857 #endif // defined(OS_MACOSX) | 857 #endif // defined(OS_MACOSX) |
858 | 858 |
859 #if defined(OS_MACOSX) | |
860 // Very large images or svg canvases can cause huge mallocs. Skia | |
861 // does tricks on tcmalloc-based systems to allow malloc to fail with | |
862 // a NULL rather than hit the oom crasher. This replicates that for | |
863 // OSX. | |
864 // TODO(shess): Weird place to put it, but this is where the OOM | |
865 // killer currently lives. | |
866 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
| |
867 #endif // defined(OS_MACOSX) | |
868 | |
859 } // namespace base | 869 } // namespace base |
860 | 870 |
861 #endif // BASE_PROCESS_UTIL_H_ | 871 #endif // BASE_PROCESS_UTIL_H_ |
OLD | NEW |