Differences From Artifact [a6a3da0735]:
- File
src/OFStreamObserver_poll.m
— part of check-in
[1255f3a11a]
at
2012-08-10 20:08:24
on branch trunk
— Directly use the runtime's autorelease pools.
This greatly improves performance, as it gets rid of the overhead of
OFAutoreleasePool. (user: js, size: 3507) [annotate] [blame] [check-ins using]
To Artifact [927bd4e34c]:
- File src/OFStreamObserver_poll.m — part of check-in [3c99aa51da] at 2012-09-12 06:00:25 on branch trunk — OFStreamObserver: Take a double as timeout. (user: js, size: 3545) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
116 117 118 119 120 121 122 | - (void)_removeFileDescriptorForWriting: (int)fd { [self _removeFileDescriptor: fd withEvents: POLLOUT]; } | | | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 | - (void)_removeFileDescriptorForWriting: (int)fd { [self _removeFileDescriptor: fd withEvents: POLLOUT]; } - (BOOL)observeWithTimeout: (double)timeout { void *pool = objc_autoreleasePoolPush(); struct pollfd *FDsCArray; size_t i, nFDs; [self _processQueue]; |
︙ | ︙ | |||
139 140 141 142 143 144 145 | nFDs = [FDs count]; #ifdef OPEN_MAX if (nFDs > OPEN_MAX) @throw [OFOutOfRangeException exceptionWithClass: [self class]]; #endif | | > | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | nFDs = [FDs count]; #ifdef OPEN_MAX if (nFDs > OPEN_MAX) @throw [OFOutOfRangeException exceptionWithClass: [self class]]; #endif if (poll(FDsCArray, (nfds_t)nFDs, (timeout != -1 ? timeout * 1000 : -1)) < 1) return NO; for (i = 0; i < nFDs; i++) { pool = objc_autoreleasePoolPush(); if (FDsCArray[i].revents & POLLIN) { if (FDsCArray[i].fd == cancelFD[0]) { |
︙ | ︙ |