Differences From Artifact [1e49675760]:
- File src/autorelease.m — part of check-in [d07c56a8bb] at 2017-04-02 01:06:35 on branch trunk — Add OF_CONSTRUCTOR() / OF_DESTRUCTOR() (user: js, size: 3195) [annotate] [blame] [check-ins using]
To Artifact [bf8548a62d]:
- File
src/autorelease.m
— part of check-in
[4af49a13c3]
at
2017-05-07 20:10:13
on branch trunk
— Small code style change
Casts are now written like types in variable declarations. (user: js, size: 3199) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
43 44 45 46 47 48 49 | { OF_ENSURE(of_tlskey_new(&objectsKey)); OF_ENSURE(of_tlskey_new(&topKey)); OF_ENSURE(of_tlskey_new(&sizeKey)); } #endif | | | | 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | { OF_ENSURE(of_tlskey_new(&objectsKey)); OF_ENSURE(of_tlskey_new(&topKey)); OF_ENSURE(of_tlskey_new(&sizeKey)); } #endif void * objc_autoreleasePoolPush() { #if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS) id *top = of_tlskey_get(topKey); id *objects = of_tlskey_get(objectsKey); #endif ptrdiff_t offset = top - objects; return (void *)offset; } void objc_autoreleasePoolPop(void *offset) { #if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS) id *top = of_tlskey_get(topKey); |
︙ | ︙ | |||
101 102 103 104 105 106 107 | OF_ENSURE((objects = malloc(size)) != NULL); top = objects; #if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS) OF_ENSURE(of_tlskey_set(objectsKey, objects)); | | | | 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 | OF_ENSURE((objects = malloc(size)) != NULL); top = objects; #if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS) OF_ENSURE(of_tlskey_set(objectsKey, objects)); OF_ENSURE(of_tlskey_set(sizeKey, (void *)(uintptr_t)size)); #endif } if ((uintptr_t)top >= (uintptr_t)objects + size) { ptrdiff_t diff = top - objects; size += [OFSystemInfo pageSize]; OF_ENSURE((objects = realloc(objects, size)) != NULL); #if !defined(OF_HAVE_COMPILER_TLS) && defined(OF_HAVE_THREADS) OF_ENSURE(of_tlskey_set(objectsKey, objects)); OF_ENSURE(of_tlskey_set(sizeKey, (void *)(uintptr_t)size)); #endif top = objects + diff; } *top = object; top++; |
︙ | ︙ |