Commit a9395860 authored by avi@chromium.org's avatar avi@chromium.org

Update OOM killer to patch out CFAllocator on 10.10.

BUG=45650
TEST=none
NOTRY=true

Review URL: https://codereview.chromium.org/336613002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276778 0039d316-1c4b-4281-b951-d872f2087c98
parent 192ee8b2
...@@ -438,7 +438,7 @@ void oom_killer_new() { ...@@ -438,7 +438,7 @@ void oom_killer_new() {
// === Core Foundation CFAllocators === // === Core Foundation CFAllocators ===
bool CanGetContextForCFAllocator() { bool CanGetContextForCFAllocator() {
return !base::mac::IsOSYosemiteOrLater(); return !base::mac::IsOSLaterThanYosemite_DontCallThis();
} }
CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) {
...@@ -449,7 +449,8 @@ CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { ...@@ -449,7 +449,8 @@ CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) {
return &our_allocator->_context; return &our_allocator->_context;
} else if (base::mac::IsOSLion() || } else if (base::mac::IsOSLion() ||
base::mac::IsOSMountainLion() || base::mac::IsOSMountainLion() ||
base::mac::IsOSMavericks()) { base::mac::IsOSMavericks() ||
base::mac::IsOSYosemite()) {
ChromeCFAllocatorLions* our_allocator = ChromeCFAllocatorLions* our_allocator =
const_cast<ChromeCFAllocatorLions*>( const_cast<ChromeCFAllocatorLions*>(
reinterpret_cast<const ChromeCFAllocatorLions*>(allocator)); reinterpret_cast<const ChromeCFAllocatorLions*>(allocator));
...@@ -722,8 +723,9 @@ void EnableTerminationOnOutOfMemory() { ...@@ -722,8 +723,9 @@ void EnableTerminationOnOutOfMemory() {
<< "Failed to get kCFAllocatorMallocZone allocation function."; << "Failed to get kCFAllocatorMallocZone allocation function.";
context->allocate = oom_killer_cfallocator_malloc_zone; context->allocate = oom_killer_cfallocator_malloc_zone;
} else { } else {
NSLog(@"Internals of CFAllocator not known; out-of-memory failures via " DLOG(WARNING) << "Internals of CFAllocator not known; out-of-memory "
"CFAllocator will not result in termination. http://crbug.com/45650"); "failures via CFAllocator will not result in termination. "
"http://crbug.com/45650";
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment