ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libev/ev.c
(Generate patch)

Comparing libev/ev.c (file contents):
Revision 1.64 by root, Sun Nov 4 23:14:11 2007 UTC vs.
Revision 1.65 by root, Sun Nov 4 23:29:48 2007 UTC

232 base = realloc (base, sizeof (*base) * (newcnt)); \ 232 base = realloc (base, sizeof (*base) * (newcnt)); \
233 init (base + cur, newcnt - cur); \ 233 init (base + cur, newcnt - cur); \
234 cur = newcnt; \ 234 cur = newcnt; \
235 } 235 }
236 236
237#define array_free(stem, idx) \
238 free (stem ## s idx); stem ## cnt idx = stem ## max idx = 0;
239
237/*****************************************************************************/ 240/*****************************************************************************/
238 241
239static void 242static void
240anfds_init (ANFD *base, int count) 243anfds_init (ANFD *base, int count)
241{ 244{
634} 637}
635 638
636void 639void
637loop_destroy (EV_P) 640loop_destroy (EV_P)
638{ 641{
642 int i;
643
639#if EV_USE_WIN32 644#if EV_USE_WIN32
640 if (method == EVMETHOD_WIN32 ) win32_destroy (EV_A); 645 if (method == EVMETHOD_WIN32 ) win32_destroy (EV_A);
641#endif 646#endif
642#if EV_USE_KQUEUE 647#if EV_USE_KQUEUE
643 if (method == EVMETHOD_KQUEUE) kqueue_destroy (EV_A); 648 if (method == EVMETHOD_KQUEUE) kqueue_destroy (EV_A);
649 if (method == EVMETHOD_POLL ) poll_destroy (EV_A); 654 if (method == EVMETHOD_POLL ) poll_destroy (EV_A);
650#endif 655#endif
651#if EV_USE_SELECT 656#if EV_USE_SELECT
652 if (method == EVMETHOD_SELECT) select_destroy (EV_A); 657 if (method == EVMETHOD_SELECT) select_destroy (EV_A);
653#endif 658#endif
659
660 for (i = NUMPRI; i--; )
661 array_free (pending, [i]);
662
663 array_free (fdchange, );
664 array_free (timer, );
665 array_free (periodic, );
666 array_free (idle, );
667 array_free (prepare, );
668 array_free (check, );
654 669
655 method = 0; 670 method = 0;
656 /*TODO*/ 671 /*TODO*/
657} 672}
658 673
794 809
795 if (p->w) 810 if (p->w)
796 { 811 {
797 p->w->pending = 0; 812 p->w->pending = 0;
798 813
799 (*(void (**)(EV_P_ W, int))&p->w->cb) (EV_A_ p->w, p->events); 814 ((void (*)(EV_P_ W, int))p->w->cb) (EV_A_ p->w, p->events);
800 } 815 }
801 } 816 }
802} 817}
803 818
804static void 819static void

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines