diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 20:11:43 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 20:11:43 +0000 |
commit | 6cfa339931cfe22522d911f0b88603c8350a2135 (patch) | |
tree | ce500004d9ddd42ca9a2bfef5f90ec25045d6169 /base/process_util.h | |
parent | 1336223c987ab8e0730ed2283e6788e6c4d252ed (diff) | |
download | chromium_src-6cfa339931cfe22522d911f0b88603c8350a2135.zip chromium_src-6cfa339931cfe22522d911f0b88603c8350a2135.tar.gz chromium_src-6cfa339931cfe22522d911f0b88603c8350a2135.tar.bz2 |
Catch OOMs in purgeable memory.
Recommit of r51371, this time not crashy.
BUG=http://crbug.com/47980
TEST=unit tested
Review URL: http://codereview.chromium.org/2817048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51407 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/process_util.h')
-rw-r--r-- | base/process_util.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/base/process_util.h b/base/process_util.h index 9a28282..48cef2c 100644 --- a/base/process_util.h +++ b/base/process_util.h @@ -17,6 +17,9 @@ // kinfo_proc is defined in <sys/sysctl.h>, but this forward declaration // is sufficient for the vector<kinfo_proc> below. struct kinfo_proc; +// malloc_zone_t is defined in <malloc/malloc.h>, but this forward declaration +// is sufficient for GetPurgeableZone() below. +typedef struct _malloc_zone_t malloc_zone_t; #include <mach/mach.h> #elif defined(OS_POSIX) #include <dirent.h> @@ -565,6 +568,10 @@ void EnableTerminationOnHeapCorruption(); // Turns on process termination if memory runs out. This is handled on Windows // inside RegisterInvalidParamHandler(). void EnableTerminationOnOutOfMemory(); +#if defined(OS_MACOSX) +// Exposed for testing. +malloc_zone_t* GetPurgeableZone(); +#endif #endif #if defined(UNIT_TEST) |