36
37
38
39
40
41
42
43
44
45
46
47
48
49
|
#ifdef OF_COMPILER_TLS
static __thread void *first = NULL;
static __thread OFAutoreleasePool **cache = NULL;
#else
static of_tlskey_t firstKey, cacheKey;
#endif
@implementation OFAutoreleasePool
#ifndef OF_COMPILER_TLS
+ (void)initialize
{
if (self != [OFAutoreleasePool class])
return;
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
#ifdef OF_COMPILER_TLS
static __thread void *first = NULL;
static __thread OFAutoreleasePool **cache = NULL;
#else
static of_tlskey_t firstKey, cacheKey;
#endif
id
of_autorelease(id object)
{
#ifndef OF_COMPILER_TLS
void *first = of_tlskey_get(firstKey);
#endif
if (first == NULL)
[[OFAutoreleasePool alloc] init];
return _objc_rootAutorelease(object);
}
@implementation OFAutoreleasePool
#ifndef OF_COMPILER_TLS
+ (void)initialize
{
if (self != [OFAutoreleasePool class])
return;
|
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
}
return [super alloc];
}
+ (id)addObject: (id)object
{
#ifndef OF_COMPILER_TLS
void *first = of_tlskey_get(firstKey);
#endif
if (first == NULL)
[[OFAutoreleasePool alloc] init];
return _objc_rootAutorelease(object);
}
+ (void)OF_releaseAll
{
#ifndef OF_COMPILER_TLS
void *first = of_tlskey_get(firstKey);
#endif
|
<
<
<
<
<
<
<
|
|
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
|
}
return [super alloc];
}
+ (id)addObject: (id)object
{
return of_autorelease(object);
}
+ (void)OF_releaseAll
{
#ifndef OF_COMPILER_TLS
void *first = of_tlskey_get(firstKey);
#endif
|