ObjFW  Diff

Differences From Artifact [f48e2b8969]:

To Artifact [98e7771e8f]:


51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
+ alloc
{
#if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS)
	OFAutoreleasePool **cache = of_tlskey_get(cacheKey);
#endif

	if (cache != NULL) {
		unsigned i;

		for (i = 0; i < MAX_CACHE_SIZE; i++) {
			if (cache[i] != NULL) {
				OFAutoreleasePool *pool = cache[i];
				cache[i] = NULL;
				return pool;
			}
		}
	}







<
<
|







51
52
53
54
55
56
57


58
59
60
61
62
63
64
65
+ alloc
{
#if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS)
	OFAutoreleasePool **cache = of_tlskey_get(cacheKey);
#endif

	if (cache != NULL) {


		for (size_t i = 0; i < MAX_CACHE_SIZE; i++) {
			if (cache[i] != NULL) {
				OFAutoreleasePool *pool = cache[i];
				cache[i] = NULL;
				return pool;
			}
		}
	}
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
}

+ (void)OF_handleThreadTermination
{
#if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS)
	OFAutoreleasePool **cache = of_tlskey_get(cacheKey);
#endif
	size_t i;

	if (cache != NULL) {
		for (i = 0; i < MAX_CACHE_SIZE; i++)
			[cache[i] OF_super_dealloc];

		free(cache);
		cache = NULL;
	}
}








<


|







73
74
75
76
77
78
79

80
81
82
83
84
85
86
87
88
89
}

+ (void)OF_handleThreadTermination
{
#if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS)
	OFAutoreleasePool **cache = of_tlskey_get(cacheKey);
#endif


	if (cache != NULL) {
		for (size_t i = 0; i < MAX_CACHE_SIZE; i++)
			[cache[i] OF_super_dealloc];

		free(cache);
		cache = NULL;
	}
}

154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
			free(cache);
			cache = NULL;
		}
#endif
	}

	if (cache != NULL) {
		unsigned i;

		for (i = 0; i < MAX_CACHE_SIZE; i++) {
			if (cache[i] == NULL) {
				_pool = NULL;
				_ignoreRelease = false;

				cache[i] = self;

				return;







<
<
|







151
152
153
154
155
156
157


158
159
160
161
162
163
164
165
			free(cache);
			cache = NULL;
		}
#endif
	}

	if (cache != NULL) {


		for (size_t i = 0; i < MAX_CACHE_SIZE; i++) {
			if (cache[i] == NULL) {
				_pool = NULL;
				_ignoreRelease = false;

				cache[i] = self;

				return;