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

Comparing libev/ev.c (file contents):
Revision 1.343 by root, Fri Apr 2 21:03:46 2010 UTC vs.
Revision 1.345 by sf-exg, Sat Jul 31 22:33:26 2010 UTC

196# define EV_SELECT_IS_WINSOCKET 1 196# define EV_SELECT_IS_WINSOCKET 1
197# endif 197# endif
198# undef EV_AVOID_STDIO 198# undef EV_AVOID_STDIO
199#endif 199#endif
200 200
201/* OS X, in its infinite idiocy, actually HARDCODES
202 * a limit of 1024 into their select. Where people have brains,
203 * OS X engineers apparently have a vacuum. Or maybe they were
204 * ordered to have a vacuum, or they do anything for money.
205 * This might help. Or not.
206 */
207#define _DARWIN_UNLIMITED_SELECT 1
208
201/* this block tries to deduce configuration from header-defined symbols and defaults */ 209/* this block tries to deduce configuration from header-defined symbols and defaults */
202 210
203/* try to deduce the maximum number of signals on this platform */ 211/* try to deduce the maximum number of signals on this platform */
204#if defined (EV_NSIG) 212#if defined (EV_NSIG)
205/* use what's provided */ 213/* use what's provided */
503#define ev_active(w) ((W)(w))->active 511#define ev_active(w) ((W)(w))->active
504#define ev_at(w) ((WT)(w))->at 512#define ev_at(w) ((WT)(w))->at
505 513
506#if EV_USE_REALTIME 514#if EV_USE_REALTIME
507/* sig_atomic_t is used to avoid per-thread variables or locking but still */ 515/* sig_atomic_t is used to avoid per-thread variables or locking but still */
508/* giving it a reasonably high chance of working on typical architetcures */ 516/* giving it a reasonably high chance of working on typical architectures */
509static EV_ATOMIC_T have_realtime; /* did clock_gettime (CLOCK_REALTIME) work? */ 517static EV_ATOMIC_T have_realtime; /* did clock_gettime (CLOCK_REALTIME) work? */
510#endif 518#endif
511 519
512#if EV_USE_MONOTONIC 520#if EV_USE_MONOTONIC
513static EV_ATOMIC_T have_monotonic; /* did clock_gettime (CLOCK_MONOTONIC) work? */ 521static EV_ATOMIC_T have_monotonic; /* did clock_gettime (CLOCK_MONOTONIC) work? */
786/*****************************************************************************/ 794/*****************************************************************************/
787 795
788#define MALLOC_ROUND 4096 /* prefer to allocate in chunks of this size, must be 2**n and >> 4 longs */ 796#define MALLOC_ROUND 4096 /* prefer to allocate in chunks of this size, must be 2**n and >> 4 longs */
789 797
790/* find a suitable new size for the given array, */ 798/* find a suitable new size for the given array, */
791/* hopefully by rounding to a ncie-to-malloc size */ 799/* hopefully by rounding to a nice-to-malloc size */
792inline_size int 800inline_size int
793array_nextsize (int elem, int cur, int cnt) 801array_nextsize (int elem, int cur, int cnt)
794{ 802{
795 int ncur = cur + 1; 803 int ncur = cur + 1;
796 804
1063} 1071}
1064 1072
1065/*****************************************************************************/ 1073/*****************************************************************************/
1066 1074
1067/* 1075/*
1068 * the heap functions want a real array index. array index 0 uis guaranteed to not 1076 * the heap functions want a real array index. array index 0 is guaranteed to not
1069 * be in-use at any time. the first heap entry is at array [HEAP0]. DHEAP gives 1077 * be in-use at any time. the first heap entry is at array [HEAP0]. DHEAP gives
1070 * the branching factor of the d-tree. 1078 * the branching factor of the d-tree.
1071 */ 1079 */
1072 1080
1073/* 1081/*
2171 feed_reverse_done (EV_A_ EV_PERIODIC); 2179 feed_reverse_done (EV_A_ EV_PERIODIC);
2172 } 2180 }
2173} 2181}
2174 2182
2175/* simply recalculate all periodics */ 2183/* simply recalculate all periodics */
2176/* TODO: maybe ensure that at leats one event happens when jumping forward? */ 2184/* TODO: maybe ensure that at least one event happens when jumping forward? */
2177static void noinline 2185static void noinline
2178periodics_reschedule (EV_P) 2186periodics_reschedule (EV_P)
2179{ 2187{
2180 int i; 2188 int i;
2181 2189

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines