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

Comparing libev/ev.c (file contents):
Revision 1.443 by root, Thu May 31 17:53:26 2012 UTC vs.
Revision 1.447 by root, Tue Jun 19 12:29:43 2012 UTC

1191} 1191}
1192 1192
1193static void * 1193static void *
1194ev_realloc_emul (void *ptr, long size) EV_THROW 1194ev_realloc_emul (void *ptr, long size) EV_THROW
1195{ 1195{
1196#if __GLIBC__
1197 return realloc (ptr, size);
1198#else
1199 /* some systems, notably openbsd and darwin, fail to properly 1196 /* some systems, notably openbsd and darwin, fail to properly
1200 * implement realloc (x, 0) (as required by both ansi c-89 and 1197 * implement realloc (x, 0) (as required by both ansi c-89 and
1201 * the single unix specification, so work around them here. 1198 * the single unix specification, so work around them here.
1199 * recently, also (at least) fedora and debian started breaking it,
1200 * despite documenting it otherwise.
1202 */ 1201 */
1203 1202
1204 if (size) 1203 if (size)
1205 return realloc (ptr, size); 1204 return realloc (ptr, size);
1206 1205
1207 free (ptr); 1206 free (ptr);
1208 return 0; 1207 return 0;
1209#endif
1210} 1208}
1211 1209
1212static void *(*alloc)(void *ptr, long size) EV_THROW = ev_realloc_emul; 1210static void *(*alloc)(void *ptr, long size) EV_THROW = ev_realloc_emul;
1213 1211
1214void ecb_cold 1212void ecb_cold
2045void noinline 2043void noinline
2046ev_feed_signal_event (EV_P_ int signum) EV_THROW 2044ev_feed_signal_event (EV_P_ int signum) EV_THROW
2047{ 2045{
2048 WL w; 2046 WL w;
2049 2047
2050 if (expect_false (signum <= 0 || signum > EV_NSIG)) 2048 if (expect_false (signum <= 0 || signum >= EV_NSIG))
2051 return; 2049 return;
2052 2050
2053 --signum; 2051 --signum;
2054 2052
2055#if EV_MULTIPLICITY 2053#if EV_MULTIPLICITY
2762} 2760}
2763 2761
2764void noinline 2762void noinline
2765ev_invoke_pending (EV_P) 2763ev_invoke_pending (EV_P)
2766{ 2764{
2767 for (pendingpri = NUMPRI; pendingpri--; ) /* pendingpri is modified during the loop */ 2765 pendingpri = NUMPRI;
2766
2767 while (pendingpri) /* pendingpri possibly gets modified in the inner loop */
2768 {
2769 --pendingpri;
2770
2768 while (pendingcnt [pendingpri]) 2771 while (pendingcnt [pendingpri])
2769 { 2772 {
2770 ANPENDING *p = pendings [pendingpri] + --pendingcnt [pendingpri]; 2773 ANPENDING *p = pendings [pendingpri] + --pendingcnt [pendingpri];
2771 2774
2772 p->w->pending = 0; 2775 p->w->pending = 0;
2773 EV_CB_INVOKE (p->w, p->events); 2776 EV_CB_INVOKE (p->w, p->events);
2774 EV_FREQUENT_CHECK; 2777 EV_FREQUENT_CHECK;
2775 } 2778 }
2779 }
2776} 2780}
2777 2781
2778#if EV_IDLE_ENABLE 2782#if EV_IDLE_ENABLE
2779/* make idle watchers pending. this handles the "call-idle */ 2783/* make idle watchers pending. this handles the "call-idle */
2780/* only when higher priorities are idle" logic */ 2784/* only when higher priorities are idle" logic */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines