Differences From Artifact [2098b64113]:
- File
src/OFStreamObserver_select.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: 3314) [annotate] [blame] [check-ins using]
To Artifact [a76eca16d0]:
- File src/OFStreamObserver_select.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: 3317) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
65 66 67 68 69 70 71 | { FD_CLR(fd, &writeFDs); if (!FD_ISSET(fd, &readFDs)) FD_CLR(fd, &exceptFDs); } | | | 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | { FD_CLR(fd, &writeFDs); if (!FD_ISSET(fd, &readFDs)) FD_CLR(fd, &exceptFDs); } - (BOOL)observeWithTimeout: (double)timeout { void *pool = objc_autoreleasePoolPush(); OFStream **objects; fd_set readFDs_; fd_set writeFDs_; fd_set exceptFDs_; struct timeval time; |
︙ | ︙ | |||
94 95 96 97 98 99 100 | FD_COPY(&exceptFDs, &exceptFDs_); #else readFDs_ = readFDs; writeFDs_ = writeFDs; exceptFDs_ = exceptFDs; #endif | | | | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | FD_COPY(&exceptFDs, &exceptFDs_); #else readFDs_ = readFDs; writeFDs_ = writeFDs; exceptFDs_ = exceptFDs; #endif time.tv_sec = timeout; time.tv_usec = (timeout - time.tv_sec) * 1000; if (select((int)maxFD + 1, &readFDs_, &writeFDs_, &exceptFDs_, (timeout != -1 ? &time : NULL)) < 1) return NO; if (FD_ISSET(cancelFD[0], &readFDs_)) { char buffer; |
︙ | ︙ |