From a82219690a0ce1703abdc9bf10d0d4e5a9d26efa Mon Sep 17 00:00:00 2001 From: root Date: Tue, 5 Feb 2008 23:56:33 +0000 Subject: compile without it, too, fix memleak --- ev.c | 25 +++++++++++++++---------- ev.pod | 2 +- ev_vars.h | 2 +- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/ev.c b/ev.c index 80f27e3..3ab0517 100644 --- a/ev.c +++ b/ev.c @@ -849,6 +849,7 @@ pipecb (EV_P_ ev_io *iow, int revents) ev_feed_signal_event (EV_A_ signum + 1); } +#if EV_ASYNC_ENABLE if (gotasync) { int i; @@ -861,6 +862,7 @@ pipecb (EV_P_ ev_io *iow, int revents) ev_feed_event (EV_A_ asyncs [i], EV_ASYNC); } } +#endif } /*****************************************************************************/ @@ -1081,13 +1083,19 @@ loop_init (EV_P_ unsigned int flags) } #endif - ev_rt_now = ev_time (); - mn_now = get_clock (); - now_floor = mn_now; - rtmn_diff = ev_rt_now - mn_now; + ev_rt_now = ev_time (); + mn_now = get_clock (); + now_floor = mn_now; + rtmn_diff = ev_rt_now - mn_now; io_blocktime = 0.; timeout_blocktime = 0.; + backend = 0; + backend_fd = -1; + gotasync = 0; +#if EV_USE_INOTIFY + fs_fd = -2; +#endif /* pid check not overridable via env */ #ifndef _WIN32 @@ -1103,12 +1111,6 @@ loop_init (EV_P_ unsigned int flags) if (!(flags & 0x0000ffffUL)) flags |= ev_recommended_backends (); - backend = 0; - backend_fd = -1; -#if EV_USE_INOTIFY - fs_fd = -2; -#endif - #if EV_USE_PORT if (!backend && (flags & EVBACKEND_PORT )) backend = port_init (EV_A_ flags); #endif @@ -1189,6 +1191,9 @@ loop_destroy (EV_P) #endif array_free (prepare, EMPTY); array_free (check, EMPTY); +#if EV_ASYNC_ENABLE + array_free (async, EMPTY); +#endif backend = 0; } diff --git a/ev.pod b/ev.pod index 16bf5be..b55d936 100644 --- a/ev.pod +++ b/ev.pod @@ -2944,7 +2944,7 @@ on backend and wether C was used). Priorities are implemented by allocating some space for each priority. When doing priority-based operations, libev usually has to linearly search all the priorities, but starting/stopping and activating -watchers becomes O(1) w.r.t. prioritiy handling. +watchers becomes O(1) w.r.t. priority handling. =item Sending an ev_async: O(1) diff --git a/ev_vars.h b/ev_vars.h index c9637f2..249aa2f 100644 --- a/ev_vars.h +++ b/ev_vars.h @@ -140,8 +140,8 @@ VARx(int, forkmax) VARx(int, forkcnt) #endif -#if EV_ASYNC_ENABLE || EV_GENWRAP VARx(EV_ATOMIC_T, gotasync) +#if EV_ASYNC_ENABLE || EV_GENWRAP VARx(struct ev_async **, asyncs) VARx(int, asyncmax) VARx(int, asynccnt) -- cgit v1.2.3