X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/c56a8061de2b5b4b9760ed49d4600bf40991b797..b3c85cba31a5669ce3e1995d8660542354957a53:/ev.c?ds=inline diff --git a/ev.c b/ev.c index 1d0a5bf..32369d3 100644 --- a/ev.c +++ b/ev.c @@ -204,11 +204,8 @@ extern "C" { # define EV_USE_REALTIME 0 #endif -#if EV_SELECT_IS_WINSOCKET -# include -#endif - #if !EV_STAT_ENABLE +# undef EV_USE_INOTIFY # define EV_USE_INOTIFY 0 #endif @@ -216,6 +213,10 @@ extern "C" { # include #endif +#if EV_SELECT_IS_WINSOCKET +# include +#endif + /**/ /* @@ -232,7 +233,7 @@ extern "C" { #define MAX_BLOCKTIME 59.743 /* never wait longer than this time (to detect time jumps) */ /*#define CLEANUP_INTERVAL (MAX_BLOCKTIME * 5.) /* how often to try to free memory and re-check fds, TODO */ -#if __GNUC__ >= 3 +#if __GNUC__ >= 4 # define expect(expr,value) __builtin_expect ((expr),(value)) # define noinline __attribute__ ((noinline)) #else @@ -1039,11 +1040,16 @@ loop_destroy (EV_P) #endif } + ev_free (anfds); anfdmax = 0; + /* have to use the microsoft-never-gets-it-right macro */ array_free (fdchange, EMPTY); array_free (timer, EMPTY); #if EV_PERIODIC_ENABLE array_free (periodic, EMPTY); +#endif +#if EV_FORK_ENABLE + array_free (fork, EMPTY); #endif array_free (prepare, EMPTY); array_free (check, EMPTY); @@ -2178,7 +2184,7 @@ ev_check_stop (EV_P_ ev_check *w) void noinline ev_embed_sweep (EV_P_ ev_embed *w) { - ev_loop (w->loop, EVLOOP_NONBLOCK); + ev_loop (w->other, EVLOOP_NONBLOCK); } static void @@ -2199,7 +2205,7 @@ ev_embed_start (EV_P_ ev_embed *w) return; { - struct ev_loop *loop = w->loop; + struct ev_loop *loop = w->other; assert (("loop to be embedded is not embeddable", backend & ev_embeddable_backends ())); ev_io_init (&w->io, embed_cb, backend_fd, EV_READ); } @@ -2316,6 +2322,10 @@ ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, vo } } +#if EV_MULTIPLICITY + #include "ev_wrap.h" +#endif + #ifdef __cplusplus } #endif