ObjFW  Diff

Differences From Artifact [6326631fd1]:

To Artifact [6cf9fdd824]:


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
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







-
-



+
+
+






-
-







 * file.
 */

#include "config.h"

#include <stdlib.h>

#include <assert.h>

#import "OFAutoreleasePool.h"
#import "OFArray.h"

#import "OFNotImplementedException.h"

#import "macros.h"
#ifndef OF_COMPILER_TLS
# import "threading.h"

# import "OFInitializationFailedException.h"
#endif

#import "OFNotImplementedException.h"

extern id _objc_rootAutorelease(id);
extern void* objc_autoreleasePoolPush(void);
extern void objc_autoreleasePoolPop(void*);

#ifdef OF_COMPILER_TLS
static __thread void *first = NULL;
#else
86
87
88
89
90
91
92
93

94
95
96
97
98
99
100
85
86
87
88
89
90
91

92
93
94
95
96
97
98
99







-
+








		pool = objc_autoreleasePoolPush();

		if (first == NULL)
#ifdef OF_COMPILER_TLS
			first = pool;
#else
			assert(of_tlskey_set(firstKey, pool));
			OF_ENSURE(of_tlskey_set(firstKey, pool));
#endif

		_objc_rootAutorelease(self);
	} @catch (id e) {
		[self release];
		@throw e;
	}
132
133
134
135
136
137
138
139

140
141
142
143
144
145
146
131
132
133
134
135
136
137

138
139
140
141
142
143
144
145







-
+







	ignoreRelease = YES;

#ifdef OF_COMPILER_TLS
	if (first == pool)
		first = NULL;
#else
	if (of_tlskey_get(firstKey) == pool)
		assert(of_tlskey_set(firstKey, NULL));
		OF_ENSURE(of_tlskey_set(firstKey, NULL));
#endif

	objc_autoreleasePoolPop(pool);

	[super dealloc];
}