| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "base/process_util_unittest_mac.h" |
| 6 |
| 7 #import <Cocoa/Cocoa.h> |
| 8 |
| 9 @interface PsychoticallyBigObjCObject : NSObject |
| 10 { |
| 11 #if __LP64__ |
| 12 // On 64 bits, Objective C objects have no size limit that I can find. |
| 13 int tooBigToCount_[0xF000000000000000U / sizeof(int)]; |
| 14 #else |
| 15 // On 32 bits, Objective C objects must be < 2G in size. |
| 16 int justUnder2Gigs_[(2U * 1024 * 1024 * 1024 - 1) / sizeof(int)]; |
| 17 #endif |
| 18 } |
| 19 |
| 20 @end |
| 21 |
| 22 @implementation PsychoticallyBigObjCObject |
| 23 |
| 24 @end |
| 25 |
| 26 |
| 27 namespace base { |
| 28 |
| 29 void* AllocateViaCFAllocatorSystemDefault(int32 size) { |
| 30 return CFAllocatorAllocate(kCFAllocatorSystemDefault, size, 0); |
| 31 } |
| 32 |
| 33 void* AllocateViaCFAllocatorMalloc(int32 size) { |
| 34 return CFAllocatorAllocate(kCFAllocatorMalloc, size, 0); |
| 35 } |
| 36 |
| 37 void* AllocateViaCFAllocatorMallocZone(int32 size) { |
| 38 return CFAllocatorAllocate(kCFAllocatorMallocZone, size, 0); |
| 39 } |
| 40 |
| 41 void* AllocatePsychoticallyBigObjCObject() { |
| 42 return [[PsychoticallyBigObjCObject alloc] init]; |
| 43 } |
| 44 |
| 45 } // namespace base |
| OLD | NEW |