-
Notifications
You must be signed in to change notification settings - Fork 517
/
Copy pathMRCBase.m
46 lines (40 loc) · 1008 Bytes
/
MRCBase.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//
// MRCBase.m
// TestARCLayouts
//
// Created by Patrick Beard on 3/8/11.
// Copyright 2011 __MyCompanyName__. All rights reserved.
//
#include "MRCBase.h"
#include "test.h"
// MRCBase->alignment ensures that there is a gap between the end of
// NSObject's ivars and the start of MRCBase's ivars, which exercises
// handling of storage that is not represented in any class's ivar
// layout bitmaps.
#if __has_feature(objc_arc_weak)
bool supportsMRCWeak = true;
#else
bool supportsMRCWeak = false;
#endif
@interface MRCBase () {
@private
double DOUBLEWORD_ALIGNED alignment;
uintptr_t pad[3]; // historically this made OBJC2 layout bitmaps match OBJC1
double number;
id object;
void *pointer;
#if __has_feature(objc_arc_weak)
__weak
#endif
id delegate;
}
@end
@implementation MRCBase
@synthesize number, object, pointer, delegate;
@end
// Call object_copy from MRC.
extern id __attribute__((ns_returns_retained))
docopy(id obj)
{
return object_copy(obj, 0);
}