Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Side by Side Diff: base/process_util_unittest_mac.mm

Issue 875004: Die on an OOM situation in many more cases.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « base/process_util_unittest_mac.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Name: svn:eol-style
+ LF
OLDNEW
(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
OLDNEW
« no previous file with comments | « base/process_util_unittest_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698