| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "base/process/memory.h" | 5 #include "base/process/memory.h" |
| 6 | 6 |
| 7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
| 8 #import <Foundation/Foundation.h> |
| 8 #include <errno.h> | 9 #include <errno.h> |
| 9 #include <mach/mach.h> | 10 #include <mach/mach.h> |
| 10 #include <mach/mach_vm.h> | 11 #include <mach/mach_vm.h> |
| 11 #include <malloc/malloc.h> | 12 #include <malloc/malloc.h> |
| 12 #import <objc/runtime.h> | 13 #import <objc/runtime.h> |
| 13 #include <stddef.h> | 14 #include <stddef.h> |
| 14 | 15 |
| 15 #include <new> | 16 #include <new> |
| 16 | 17 |
| 17 #include "base/lazy_instance.h" | 18 #include "base/lazy_instance.h" |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 @selector(allocWithZone:)); | 543 @selector(allocWithZone:)); |
| 543 g_old_allocWithZone = reinterpret_cast<allocWithZone_t>( | 544 g_old_allocWithZone = reinterpret_cast<allocWithZone_t>( |
| 544 method_getImplementation(orig_method)); | 545 method_getImplementation(orig_method)); |
| 545 CHECK(g_old_allocWithZone) | 546 CHECK(g_old_allocWithZone) |
| 546 << "Failed to get allocWithZone allocation function."; | 547 << "Failed to get allocWithZone allocation function."; |
| 547 method_setImplementation(orig_method, | 548 method_setImplementation(orig_method, |
| 548 reinterpret_cast<IMP>(oom_killer_allocWithZone)); | 549 reinterpret_cast<IMP>(oom_killer_allocWithZone)); |
| 549 } | 550 } |
| 550 | 551 |
| 551 } // namespace base | 552 } // namespace base |
| OLD | NEW |