Differences From Artifact [14bd700788]:
- File
src/OFAutoreleasePool.m
— part of check-in
[f92e1c77a0]
at
2010-07-08 09:20:54
on branch trunk
— Optimize OFAutoreleasePool.
It always allocates memory for 16 objects now. releaseObjects does not
free the memory allocated to store objects so that the same number of
objects can be stored in the autorelease pool again without the need to
allocate memory. This will give loops creating lots of objects a huge
performance boost. (user: js, size: 3837) [annotate] [blame] [check-ins using]
To Artifact [0e3d14e495]:
- File
src/OFAutoreleasePool.m
— part of check-in
[e2b06423e0]
at
2010-09-05 23:19:08
on branch trunk
— Replace OFObject* with id in many places.
We assume now that every object understands retain, release, etc. so
that we can weaken the type from OFObject* to id. This makes it
possible to use different root object classes. (user: js, size: 3823) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
35 36 37 38 39 40 41 | return; if (!of_tlskey_new(&first_key) || !of_tlskey_new(&last_key)) @throw [OFInitializationFailedException newWithClass: self]; } #endif | | | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | return; if (!of_tlskey_new(&first_key) || !of_tlskey_new(&last_key)) @throw [OFInitializationFailedException newWithClass: self]; } #endif + (void)addObjectToTopmostPool: (id)obj { #ifdef OF_THREADS id last = of_tlskey_get(last_key); #endif if (last == nil) { @try { |
︙ | ︙ | |||
129 130 131 132 133 134 135 | [self dealloc]; @throw e; } return self; } | | | 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 | [self dealloc]; @throw e; } return self; } - (void)addObject: (id)obj { if (count + 1 > size) { objects = [self resizeMemory: objects toNItems: size + GROW_SIZE withSize: sizeof(id)]; size += GROW_SIZE; } |
︙ | ︙ |