Differences From Artifact [f48e2b8969]:
- File
src/OFAutoreleasePool.m
— part of check-in
[2a27cf3000]
at
2016-01-03 00:41:26
on branch trunk
— Update copyright
While at it, also update the mail address. (user: js, size: 3319) [annotate] [blame] [check-ins using] [more...]
To Artifact [98e7771e8f]:
- File src/OFAutoreleasePool.m — part of check-in [e0b9167693] at 2016-02-21 15:37:42 on branch trunk — Make use of C99-style for loops (user: js, size: 3299) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
51 52 53 54 55 56 57 |
+ alloc
{
#if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS)
OFAutoreleasePool **cache = of_tlskey_get(cacheKey);
#endif
if (cache != NULL) {
| < < | | 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 |
}
+ (void)OF_handleThreadTermination
{
#if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS)
OFAutoreleasePool **cache = of_tlskey_get(cacheKey);
#endif
| < | | 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 |
free(cache);
cache = NULL;
}
#endif
}
if (cache != NULL) {
| < < | | 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;
|
| ︙ | ︙ |