| 438 |
// === Core Foundation CFAllocators === |
// === Core Foundation CFAllocators === |
| 439 |
|
|
| 440 |
bool CanGetContextForCFAllocator() { |
bool CanGetContextForCFAllocator() { |
| 441 |
return !base::mac::IsOSYosemiteOrLater(); |
return !base::mac::IsOSLaterThanYosemite_DontCallThis(); |
| 442 |
} |
} |
| 443 |
|
|
| 444 |
CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { |
CFAllocatorContext* ContextForCFAllocator(CFAllocatorRef allocator) { |
| 449 |
return &our_allocator->_context; |
return &our_allocator->_context; |
| 450 |
} else if (base::mac::IsOSLion() || |
} else if (base::mac::IsOSLion() || |
| 451 |
base::mac::IsOSMountainLion() || |
base::mac::IsOSMountainLion() || |
| 452 |
base::mac::IsOSMavericks()) { |
base::mac::IsOSMavericks() || |
| 453 |
|
base::mac::IsOSYosemite()) { |
| 454 |
ChromeCFAllocatorLions* our_allocator = |
ChromeCFAllocatorLions* our_allocator = |
| 455 |
const_cast<ChromeCFAllocatorLions*>( |
const_cast<ChromeCFAllocatorLions*>( |
| 456 |
reinterpret_cast<const ChromeCFAllocatorLions*>(allocator)); |
reinterpret_cast<const ChromeCFAllocatorLions*>(allocator)); |
| 723 |
<< "Failed to get kCFAllocatorMallocZone allocation function."; |
<< "Failed to get kCFAllocatorMallocZone allocation function."; |
| 724 |
context->allocate = oom_killer_cfallocator_malloc_zone; |
context->allocate = oom_killer_cfallocator_malloc_zone; |
| 725 |
} else { |
} else { |
| 726 |
NSLog(@"Internals of CFAllocator not known; out-of-memory failures via " |
DLOG(WARNING) << "Internals of CFAllocator not known; out-of-memory " |
| 727 |
"CFAllocator will not result in termination. http://crbug.com/45650"); |
"failures via CFAllocator will not result in termination. " |
| 728 |
|
"http://crbug.com/45650"; |
| 729 |
} |
} |
| 730 |
#endif |
#endif |
| 731 |
|
|