- ev_start (EV_A_ (W)w, ++preparecnt);
- array_needsize (ev_prepare *, prepares, preparemax, preparecnt, EMPTY2);
- prepares [preparecnt - 1] = w;
+ /* since we use memcmp, we need to clear any padding data etc. */
+ memset (&w->prev, 0, sizeof (ev_statdata));
+ memset (&w->attr, 0, sizeof (ev_statdata));
+
+ ev_stat_stat (EV_A_ w);
+
+ if (w->interval < MIN_STAT_INTERVAL)
+ w->interval = w->interval ? MIN_STAT_INTERVAL : DEF_STAT_INTERVAL;
+
+ ev_timer_init (&w->timer, stat_timer_cb, w->interval, w->interval);
+ ev_set_priority (&w->timer, ev_priority (w));
+ ev_timer_start (EV_A_ &w->timer);
+
+ ev_start (EV_A_ (W)w, 1);