ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev_kqueue.c
(Generate patch)

Comparing libev/ev_kqueue.c (file contents):
Revision 1.27 by root, Wed Nov 28 11:15:55 2007 UTC vs.
Revision 1.28 by root, Wed Dec 5 13:54:37 2007 UTC

81 81
82 /* need to resize so there is enough space for errors */ 82 /* need to resize so there is enough space for errors */
83 if (kqueue_changecnt > kqueue_eventmax) 83 if (kqueue_changecnt > kqueue_eventmax)
84 { 84 {
85 ev_free (kqueue_events); 85 ev_free (kqueue_events);
86 kqueue_eventmax = array_roundsize (struct kevent, kqueue_changecnt); 86 kqueue_eventmax = array_nextsize (sizeof (struct kevent), kqueue_eventmax, kqueue_changecnt);
87 kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax); 87 kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax);
88 } 88 }
89 89
90 ts.tv_sec = (time_t)timeout; 90 ts.tv_sec = (time_t)timeout;
91 ts.tv_nsec = (long)((timeout - (ev_tstamp)ts.tv_sec) * 1e9); 91 ts.tv_nsec = (long)((timeout - (ev_tstamp)ts.tv_sec) * 1e9);
135 } 135 }
136 136
137 if (expect_false (res == kqueue_eventmax)) 137 if (expect_false (res == kqueue_eventmax))
138 { 138 {
139 ev_free (kqueue_events); 139 ev_free (kqueue_events);
140 kqueue_eventmax = array_roundsize (struct kevent, kqueue_eventmax << 1); 140 kqueue_eventmax = array_nextsize (sizeof (struct kevent), kqueue_eventmax, kqueue_eventmax + 1);
141 kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax); 141 kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax);
142 } 142 }
143} 143}
144 144
145int inline_size 145int inline_size

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines