@@ -20,17 +20,17 @@ #include #import "OFMutableArray.h" #import "OFMutableArray_adjacent.h" -#import "OFAutoreleasePool.h" #import "OFEnumerationMutationException.h" #import "OFInvalidArgumentException.h" #import "OFNotImplementedException.h" #import "OFOutOfRangeException.h" +#import "autorelease.h" #import "macros.h" static struct { Class isa; } placeholder; @@ -198,11 +198,11 @@ } - (void)insertObjectsFromArray: (OFArray*)array atIndex: (size_t)index { - OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init]; + void *pool = objc_autoreleasePoolPush(); OFEnumerator *enumerator = [array objectEnumerator]; size_t i, count = [array count]; for (i = 0; i < count; i++) { id object = [enumerator nextObject]; @@ -211,11 +211,11 @@ [self insertObject: object atIndex: index + i]; } - [pool release]; + objc_autoreleasePoolPop(pool); } - (void)replaceObjectAtIndex: (size_t)index withObject: (id)object {