| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_unittest_mac.h" | 5 #include "base/process/memory_unittest_mac.h" |
| 6 #include "build/build_config.h" |
| 6 | 7 |
| 7 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
| 8 #include <CoreFoundation/CoreFoundation.h> | 9 #include <CoreFoundation/CoreFoundation.h> |
| 9 | 10 |
| 10 #if !defined(ARCH_CPU_64_BITS) | 11 #if !defined(ARCH_CPU_64_BITS) |
| 11 | 12 |
| 12 // In the 64-bit environment, the Objective-C 2.0 Runtime Reference states | 13 // In the 64-bit environment, the Objective-C 2.0 Runtime Reference states |
| 13 // that sizeof(anInstance) is constrained to 32 bits. That's not necessarily | 14 // that sizeof(anInstance) is constrained to 32 bits. That's not necessarily |
| 14 // "psychotically big" and in fact a 64-bit program is expected to be able to | 15 // "psychotically big" and in fact a 64-bit program is expected to be able to |
| 15 // successfully allocate an object that large, likely reserving a good deal of | 16 // successfully allocate an object that large, likely reserving a good deal of |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 51 |
| 51 void* AllocateViaCFAllocatorMalloc(ssize_t size) { | 52 void* AllocateViaCFAllocatorMalloc(ssize_t size) { |
| 52 return CFAllocatorAllocate(kCFAllocatorMalloc, size, 0); | 53 return CFAllocatorAllocate(kCFAllocatorMalloc, size, 0); |
| 53 } | 54 } |
| 54 | 55 |
| 55 void* AllocateViaCFAllocatorMallocZone(ssize_t size) { | 56 void* AllocateViaCFAllocatorMallocZone(ssize_t size) { |
| 56 return CFAllocatorAllocate(kCFAllocatorMallocZone, size, 0); | 57 return CFAllocatorAllocate(kCFAllocatorMallocZone, size, 0); |
| 57 } | 58 } |
| 58 | 59 |
| 59 } // namespace base | 60 } // namespace base |
| OLD | NEW |