return ev_time ();
}
-#define array_nextsize(n) (((n) << 1) | 4 & ~3)
-#define array_prevsize(n) (((n) >> 1) | 4 & ~3)
+#define array_roundsize(base,n) ((n) | 4 & ~3)
#define array_needsize(base,cur,cnt,init) \
if ((cnt) > cur) \
int newcnt = cur; \
do \
{ \
- newcnt = array_nextsize (newcnt); \
+ newcnt = array_roundsize (base, newcnt << 1); \
} \
while ((cnt) > newcnt); \
\
static void
event (W w, int events)
{
- if (w->active)
- {
- w->pending = ++pendingcnt;
- array_needsize (pendings, pendingmax, pendingcnt, );
- pendings [pendingcnt - 1].w = w;
- pendings [pendingcnt - 1].events = events;
- }
+ w->pending = ++pendingcnt;
+ array_needsize (pendings, pendingmax, pendingcnt, );
+ pendings [pendingcnt - 1].w = w;
+ pendings [pendingcnt - 1].events = events;
}
static void
{
struct ev_timer *w = timers [0];
- event ((W)w, EV_TIMEOUT);
-
/* first reschedule or stop timer */
if (w->repeat)
{
}
else
ev_timer_stop (w); /* nonrepeating: stop timer */
+
+ event ((W)w, EV_TIMEOUT);
}
}