X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/e7e7177a1b3a13f8534fca81c48c4d063fddbbd3..7c2c0ecea2a4196af25910beaaf0faa4468e8e52:/ev_kqueue.c diff --git a/ev_kqueue.c b/ev_kqueue.c index 7a34e9b..4fd649f 100644 --- a/ev_kqueue.c +++ b/ev_kqueue.c @@ -36,7 +36,7 @@ #include #include -static void +void inline_speed kqueue_change (EV_P_ int fd, int filter, int flags, int fflags) { struct kevent *ke; @@ -83,7 +83,7 @@ kqueue_poll (EV_P_ ev_tstamp timeout) if (kqueue_changecnt > kqueue_eventmax) { ev_free (kqueue_events); - kqueue_eventmax = array_roundsize (struct kevent, kqueue_changecnt); + kqueue_eventmax = array_nextsize (sizeof (struct kevent), kqueue_eventmax, kqueue_changecnt); kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax); } @@ -137,12 +137,12 @@ kqueue_poll (EV_P_ ev_tstamp timeout) if (expect_false (res == kqueue_eventmax)) { ev_free (kqueue_events); - kqueue_eventmax = array_roundsize (struct kevent, kqueue_eventmax << 1); + kqueue_eventmax = array_nextsize (sizeof (struct kevent), kqueue_eventmax, kqueue_eventmax + 1); kqueue_events = (struct kevent *)ev_malloc (sizeof (struct kevent) * kqueue_eventmax); } } -static int +int inline_size kqueue_init (EV_P_ int flags) { struct kevent ch, ev; @@ -168,16 +168,14 @@ kqueue_init (EV_P_ int flags) return EVBACKEND_KQUEUE; } -static void +void inline_size kqueue_destroy (EV_P) { - close (backend_fd); - ev_free (kqueue_events); ev_free (kqueue_changes); } -static void +void inline_size kqueue_fork (EV_P) { close (backend_fd);