@@ -30,11 +30,10 @@ #import "OFDataArray.h" #ifdef _WIN32 # import "OFTCPSocket.h" #endif #import "OFThread.h" -#import "OFAutoreleasePool.h" #ifdef HAVE_KQUEUE # import "OFStreamObserver_kqueue.h" #endif #ifdef HAVE_POLL_H @@ -46,10 +45,11 @@ #import "OFInitializationFailedException.h" #import "OFNotImplementedException.h" #import "OFOutOfRangeException.h" +#import "autorelease.h" #import "macros.h" enum { QUEUE_ADD = 0, QUEUE_REMOVE = 1, @@ -376,28 +376,26 @@ selector: _cmd]; } - (BOOL)_processCache { - OFAutoreleasePool *pool; OFStream **objects = [readStreams objects]; size_t i, count = [readStreams count]; BOOL foundInCache = NO; - pool = [[OFAutoreleasePool alloc] init]; for (i = 0; i < count; i++) { + if ([objects[i] pendingBytes] > 0 && ![objects[i] _isWaitingForDelimiter]) { + void *pool = objc_autoreleasePoolPush(); [delegate streamIsReadyForReading: objects[i]]; foundInCache = YES; - [pool releaseObjects]; + objc_autoreleasePoolPop(pool); } } - [pool release]; - /* * As long as we have data in the cache for any stream, we don't want * to block. */ if (foundInCache)