Differences From Artifact [ef7d60eaa2]:
- File
src/OFStreamObserver_kqueue.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: 3486) [annotate] [blame] [check-ins using]
To Artifact [5936ea8b18]:
- File src/OFStreamObserver_kqueue.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: 3563) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
94 95 96 97 98 99 100 | { struct kevent event; EV_SET(&event, fd, EVFILT_WRITE, EV_DELETE, 0, 0, 0); [changeList addItem: &event]; } | | | > > > | 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 | { struct kevent event; EV_SET(&event, fd, EVFILT_WRITE, EV_DELETE, 0, 0, 0); [changeList addItem: &event]; } - (BOOL)observeWithTimeout: (double)timeout { void *pool = objc_autoreleasePoolPush(); struct timespec timespec; struct kevent eventList[EVENTLIST_SIZE]; int i, events; timespec.tv_sec = timeout; timespec.tv_nsec = (timeout - timespec.tv_sec) * 1000000000; [self _processQueue]; if ([self _processCache]) { objc_autoreleasePoolPop(pool); return YES; } |
︙ | ︙ |