Overview
Comment: | Let - release return void again.
If you want to know if it will be released, you can just get the retain |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
6d589825cd527020d6ba523a7b5733e8 |
User & Date: | js on 2009-05-13 20:39:59 |
Other Links: | manifest | tags |
Context
2009-05-14
| ||
13:46 | Two small fixes for OFAutoreleasePool. check-in: af41efe079 user: js tags: trunk | |
2009-05-13
| ||
20:39 | Let - release return void again. check-in: 6d589825cd user: js tags: trunk | |
20:31 | Rename - free to - (void)dealloc. check-in: 9e6dd00ef5 user: js tags: trunk | |
Changes
Modified src/OFAutoreleasePool.m from [4d907e6ad8] to [99c26c51d9].
︙ | ︙ | |||
108 109 110 111 112 113 114 | [objects add: obj]; [obj release]; return self; } | | < | | 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 | [objects add: obj]; [obj release]; return self; } - (void)release { [self releaseObjects]; [super release]; } - releaseObjects { if (objects == nil) return self; |
︙ | ︙ |
Modified src/OFConstString.m from [1f3962463d] to [0526475295].
︙ | ︙ | |||
27 28 29 30 31 32 33 | #endif - retain { return self; } | | < | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #endif - retain { return self; } - (void)release { } - (size_t)retainCount { return 1; } |
︙ | ︙ |
Modified src/OFObject.h from [aacf1f5953] to [9df3b05f63].
︙ | ︙ | |||
199 200 201 202 203 204 205 | * \return The retain count */ - (size_t)retainCount; /** * Decreases the retain cound and deallocates the object if it reaches 0. */ | | | 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 | * \return The retain count */ - (size_t)retainCount; /** * Decreases the retain cound and deallocates the object if it reaches 0. */ - (void)release; /** * Deallocates the object and also frees all memory allocated via its memory * pool. */ - (void)dealloc; @end |
Modified src/OFObject.m from [e6b5b1a83b] to [6b8000ea51].
︙ | ︙ | |||
364 365 366 367 368 369 370 | } - (size_t)retainCount { return PRE_IVAR->retain_count; } | | | < < < < | 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 | } - (size_t)retainCount { return PRE_IVAR->retain_count; } - (void)release { if (!--PRE_IVAR->retain_count) [self dealloc]; } - (void)dealloc { void **iter = PRE_IVAR->memchunks + PRE_IVAR->memchunks_size; while (iter-- > PRE_IVAR->memchunks) |
︙ | ︙ |
Modified tests/OFAutoreleasePool/OFAutoreleasePool.m from [558bb07388] to [ca3ccd4ed1].
︙ | ︙ | |||
28 29 30 31 32 33 34 | IMP init; IMP retain; IMP release; @interface TestObject: OFObject - init; - retain; | | | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | IMP init; IMP retain; IMP release; @interface TestObject: OFObject - init; - retain; - (void)release; @end @implementation TestObject - init { id ret; |
︙ | ︙ | |||
57 58 59 60 61 62 63 | ret = retain(self, _cmd); printf("Retaining %s to " ZD "\n", [self name], [ret retainCount]); return ret; } | | < | | 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | ret = retain(self, _cmd); printf("Retaining %s to " ZD "\n", [self name], [ret retainCount]); return ret; } - (void)release { releases++; printf("Releasing %s to " ZD "\n", [self name], [self retainCount] - 1); release(self, _cmd); } @end int main() { inits = retains = releases = 0; |
︙ | ︙ |