diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 16:25:53 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-01 16:25:53 +0000 |
commit | d3bf9da2e8e0162dd4429aaaf7b6a0bbeef93472 (patch) | |
tree | d006f76bd26df4dd531ee4e679f0110b7ed97cbf /base/process_util.h | |
parent | 508d27e151318b0a2ffdc6a4089ea3613462c26d (diff) | |
download | chromium_src-d3bf9da2e8e0162dd4429aaaf7b6a0bbeef93472.zip chromium_src-d3bf9da2e8e0162dd4429aaaf7b6a0bbeef93472.tar.gz chromium_src-d3bf9da2e8e0162dd4429aaaf7b6a0bbeef93472.tar.bz2 |
Catch OOMs in purgeable memory.
BUG=http://crbug.com/47980
TEST=unit tested
Review URL: http://codereview.chromium.org/2859036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51371 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) |