… | |
… | |
511 | #define ev_active(w) ((W)(w))->active |
511 | #define ev_active(w) ((W)(w))->active |
512 | #define ev_at(w) ((WT)(w))->at |
512 | #define ev_at(w) ((WT)(w))->at |
513 | |
513 | |
514 | #if EV_USE_REALTIME |
514 | #if EV_USE_REALTIME |
515 | /* 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 */ |
516 | /* giving it a reasonably high chance of working on typical architetcures */ |
516 | /* giving it a reasonably high chance of working on typical architectures */ |
517 | static EV_ATOMIC_T have_realtime; /* did clock_gettime (CLOCK_REALTIME) work? */ |
517 | static EV_ATOMIC_T have_realtime; /* did clock_gettime (CLOCK_REALTIME) work? */ |
518 | #endif |
518 | #endif |
519 | |
519 | |
520 | #if EV_USE_MONOTONIC |
520 | #if EV_USE_MONOTONIC |
521 | static EV_ATOMIC_T have_monotonic; /* did clock_gettime (CLOCK_MONOTONIC) work? */ |
521 | static EV_ATOMIC_T have_monotonic; /* did clock_gettime (CLOCK_MONOTONIC) work? */ |
… | |
… | |
794 | /*****************************************************************************/ |
794 | /*****************************************************************************/ |
795 | |
795 | |
796 | #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 */ |
797 | |
797 | |
798 | /* find a suitable new size for the given array, */ |
798 | /* find a suitable new size for the given array, */ |
799 | /* hopefully by rounding to a ncie-to-malloc size */ |
799 | /* hopefully by rounding to a nice-to-malloc size */ |
800 | inline_size int |
800 | inline_size int |
801 | array_nextsize (int elem, int cur, int cnt) |
801 | array_nextsize (int elem, int cur, int cnt) |
802 | { |
802 | { |
803 | int ncur = cur + 1; |
803 | int ncur = cur + 1; |
804 | |
804 | |
… | |
… | |
1071 | } |
1071 | } |
1072 | |
1072 | |
1073 | /*****************************************************************************/ |
1073 | /*****************************************************************************/ |
1074 | |
1074 | |
1075 | /* |
1075 | /* |
1076 | * 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 |
1077 | * 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 |
1078 | * the branching factor of the d-tree. |
1078 | * the branching factor of the d-tree. |
1079 | */ |
1079 | */ |
1080 | |
1080 | |
1081 | /* |
1081 | /* |
… | |
… | |
2179 | feed_reverse_done (EV_A_ EV_PERIODIC); |
2179 | feed_reverse_done (EV_A_ EV_PERIODIC); |
2180 | } |
2180 | } |
2181 | } |
2181 | } |
2182 | |
2182 | |
2183 | /* simply recalculate all periodics */ |
2183 | /* simply recalculate all periodics */ |
2184 | /* 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? */ |
2185 | static void noinline |
2185 | static void noinline |
2186 | periodics_reschedule (EV_P) |
2186 | periodics_reschedule (EV_P) |
2187 | { |
2187 | { |
2188 | int i; |
2188 | int i; |
2189 | |
2189 | |