#if EV_FEATURE_CODE
# define inline_speed ecb_inline
#else
-# define inline_speed static noinline
+# define inline_speed noinline static
#endif
#define NUMPRI (EV_MAXPRI - EV_MINPRI + 1)
#include <float.h>
/* a floor() replacement function, should be independent of ev_tstamp type */
-static ev_tstamp noinline
+noinline
+static ev_tstamp
ev_floor (ev_tstamp v)
{
/* the choice of shift factor is not terribly important */
# include <sys/utsname.h>
#endif
-static unsigned int noinline ecb_cold
+noinline ecb_cold
+static unsigned int
ev_linux_version (void)
{
#ifdef __linux
/*****************************************************************************/
#if EV_AVOID_STDIO
-static void noinline ecb_cold
+noinline ecb_cold
+static void
ev_printerr (const char *msg)
{
write (STDERR_FILENO, msg, strlen (msg));
static void (*syserr_cb)(const char *msg) EV_THROW;
-void ecb_cold
+ecb_cold
+void
ev_set_syserr_cb (void (*cb)(const char *msg) EV_THROW) EV_THROW
{
syserr_cb = cb;
}
-static void noinline ecb_cold
+noinline ecb_cold
+static void
ev_syserr (const char *msg)
{
if (!msg)
static void *(*alloc)(void *ptr, long size) EV_THROW = ev_realloc_emul;
-void ecb_cold
+ecb_cold
+void
ev_set_allocator (void *(*cb)(void *ptr, long size) EV_THROW) EV_THROW
{
alloc = cb;
return ncur;
}
-static void * noinline ecb_cold
+noinline ecb_cold
+static void *
array_realloc (int elem, void *base, int *cur, int cnt)
{
*cur = array_nextsize (elem, *cur, cnt);
#define array_needsize(type,base,cur,cnt,init) \
if (expect_false ((cnt) > (cur))) \
{ \
- int ecb_unused ocur_ = (cur); \
+ ecb_unused int ocur_ = (cur); \
(base) = (type *)array_realloc \
(sizeof (type), (base), &(cur), (cnt)); \
init ((base) + (ocur_), (cur) - ocur_); \
/*****************************************************************************/
/* dummy callback for pending events */
-static void noinline
+noinline
+static void
pendingcb (EV_P_ ev_prepare *w, int revents)
{
}
-void noinline
+noinline
+void
ev_feed_event (EV_P_ void *w, int revents) EV_THROW
{
W w_ = (W)w;
}
/* something about the given fd changed */
-inline_size void
+inline_size
+void
fd_change (EV_P_ int fd, int flags)
{
unsigned char reify = anfds [fd].reify;
}
/* the given fd is invalid/unusable, so make sure it doesn't hurt us anymore */
-inline_speed void ecb_cold
+inline_speed ecb_cold void
fd_kill (EV_P_ int fd)
{
ev_io *w;
}
/* check whether the given fd is actually valid, for error recovery */
-inline_size int ecb_cold
+inline_size ecb_cold int
fd_valid (int fd)
{
#ifdef _WIN32
}
/* called on EBADF to verify fds */
-static void noinline ecb_cold
+noinline ecb_cold
+static void
fd_ebadf (EV_P)
{
int fd;
}
/* called on ENOMEM in select/poll to kill some fds and retry */
-static void noinline ecb_cold
+noinline ecb_cold
+static void
fd_enomem (EV_P)
{
int fd;
}
/* usually called after fork if backend needs to re-arm all fds from scratch */
-static void noinline
+noinline
+static void
fd_rearm_all (EV_P)
{
int fd;
#if EV_SIGNAL_ENABLE || EV_ASYNC_ENABLE
-static void noinline ecb_cold
+noinline ecb_cold
+static void
evpipe_init (EV_P)
{
if (!ev_is_active (&pipe_w))
ev_feed_signal (signum);
}
-void noinline
+noinline
+void
ev_feed_signal_event (EV_P_ int signum) EV_THROW
{
WL w;
# include "ev_select.c"
#endif
-int ecb_cold
+ecb_cold int
ev_version_major (void) EV_THROW
{
return EV_VERSION_MAJOR;
}
-int ecb_cold
+ecb_cold int
ev_version_minor (void) EV_THROW
{
return EV_VERSION_MINOR;
}
/* return true if we are running with elevated privileges and should ignore env variables */
-int inline_size ecb_cold
+inline_size ecb_cold int
enable_secure (void)
{
#ifdef _WIN32
#endif
}
-unsigned int ecb_cold
+ecb_cold
+unsigned int
ev_supported_backends (void) EV_THROW
{
unsigned int flags = 0;
return flags;
}
-unsigned int ecb_cold
+ecb_cold
+unsigned int
ev_recommended_backends (void) EV_THROW
{
unsigned int flags = ev_supported_backends ();
return flags;
}
-unsigned int ecb_cold
+ecb_cold
+unsigned int
ev_embeddable_backends (void) EV_THROW
{
int flags = EVBACKEND_EPOLL | EVBACKEND_KQUEUE | EVBACKEND_PORT;
#endif
/* initialise a loop structure, must be zero-initialised */
-static void noinline ecb_cold
+noinline ecb_cold
+static void
loop_init (EV_P_ unsigned int flags) EV_THROW
{
if (!backend)
}
/* free up a loop structure */
-void ecb_cold
+ecb_cold
+void
ev_loop_destroy (EV_P)
{
int i;
#if EV_MULTIPLICITY
-struct ev_loop * ecb_cold
+ecb_cold
+struct ev_loop *
ev_loop_new (unsigned int flags) EV_THROW
{
EV_P = (struct ev_loop *)ev_malloc (sizeof (struct ev_loop));
#endif /* multiplicity */
#if EV_VERIFY
-static void noinline ecb_cold
+noinline ecb_cold
+static void
verify_watcher (EV_P_ W w)
{
assert (("libev: watcher has invalid priority", ABSPRI (w) >= 0 && ABSPRI (w) < NUMPRI));
assert (("libev: pending watcher not on pending queue", pendings [ABSPRI (w)][w->pending - 1].w == w));
}
-static void noinline ecb_cold
+noinline ecb_cold
+static void
verify_heap (EV_P_ ANHE *heap, int N)
{
int i;
}
}
-static void noinline ecb_cold
+noinline ecb_cold
+static void
array_verify (EV_P_ W *ws, int cnt)
{
while (cnt--)
#endif
#if EV_MULTIPLICITY
-struct ev_loop * ecb_cold
+ecb_cold
+struct ev_loop *
#else
int
#endif
return count;
}
-void noinline
+noinline
+void
ev_invoke_pending (EV_P)
{
pendingpri = NUMPRI;
#if EV_PERIODIC_ENABLE
-static void noinline
+noinline
+static void
periodic_recalc (EV_P_ ev_periodic *w)
{
ev_tstamp interval = w->interval > MIN_INTERVAL ? w->interval : MIN_INTERVAL;
/* simply recalculate all periodics */
/* TODO: maybe ensure that at least one event happens when jumping forward? */
-static void noinline ecb_cold
+noinline ecb_cold
+static void
periodics_reschedule (EV_P)
{
int i;
#endif
/* adjust all timers by a given offset */
-static void noinline ecb_cold
+noinline ecb_cold
+static void
timers_reschedule (EV_P_ ev_tstamp adjust)
{
int i;
/*****************************************************************************/
-void noinline
+noinline
+void
ev_io_start (EV_P_ ev_io *w) EV_THROW
{
int fd = w->fd;
EV_FREQUENT_CHECK;
}
-void noinline
+noinline
+void
ev_io_stop (EV_P_ ev_io *w) EV_THROW
{
clear_pending (EV_A_ (W)w);
EV_FREQUENT_CHECK;
}
-void noinline
+noinline
+void
ev_timer_start (EV_P_ ev_timer *w) EV_THROW
{
if (expect_false (ev_is_active (w)))
/*assert (("libev: internal timer heap corruption", timers [ev_active (w)] == (WT)w));*/
}
-void noinline
+noinline
+void
ev_timer_stop (EV_P_ ev_timer *w) EV_THROW
{
clear_pending (EV_A_ (W)w);
EV_FREQUENT_CHECK;
}
-void noinline
+noinline
+void
ev_timer_again (EV_P_ ev_timer *w) EV_THROW
{
EV_FREQUENT_CHECK;
}
#if EV_PERIODIC_ENABLE
-void noinline
+noinline
+void
ev_periodic_start (EV_P_ ev_periodic *w) EV_THROW
{
if (expect_false (ev_is_active (w)))
/*assert (("libev: internal periodic heap corruption", ANHE_w (periodics [ev_active (w)]) == (WT)w));*/
}
-void noinline
+noinline
+void
ev_periodic_stop (EV_P_ ev_periodic *w) EV_THROW
{
clear_pending (EV_A_ (W)w);
EV_FREQUENT_CHECK;
}
-void noinline
+noinline
+void
ev_periodic_again (EV_P_ ev_periodic *w) EV_THROW
{
/* TODO: use adjustheap and recalculation */
#if EV_SIGNAL_ENABLE
-void noinline
+noinline
+void
ev_signal_start (EV_P_ ev_signal *w) EV_THROW
{
if (expect_false (ev_is_active (w)))
EV_FREQUENT_CHECK;
}
-void noinline
+noinline
+void
ev_signal_stop (EV_P_ ev_signal *w) EV_THROW
{
clear_pending (EV_A_ (W)w);
#define NFS_STAT_INTERVAL 30.1074891 /* for filesystems potentially failing inotify */
#define MIN_STAT_INTERVAL 0.1074891
-static void noinline stat_timer_cb (EV_P_ ev_timer *w_, int revents);
+noinline static void stat_timer_cb (EV_P_ ev_timer *w_, int revents);
#if EV_USE_INOTIFY
/* the * 2 is to allow for alignment padding, which for some reason is >> 8 */
# define EV_INOTIFY_BUFSIZE (sizeof (struct inotify_event) * 2 + NAME_MAX)
-static void noinline
+noinline
+static void
infy_add (EV_P_ ev_stat *w)
{
w->wd = inotify_add_watch (fs_fd, w->path,
if (ev_is_active (&w->timer)) ev_unref (EV_A);
}
-static void noinline
+noinline
+static void
infy_del (EV_P_ ev_stat *w)
{
int slot;
inotify_rm_watch (fs_fd, wd);
}
-static void noinline
+noinline
+static void
infy_wd (EV_P_ int slot, int wd, struct inotify_event *ev)
{
if (slot < 0)
}
}
-inline_size void ecb_cold
+inline_size ecb_cold
+void
ev_check_2625 (EV_P)
{
/* kernels < 2.6.25 are borked
w->attr.st_nlink = 1;
}
-static void noinline
+noinline
+static void
stat_timer_cb (EV_P_ ev_timer *w_, int revents)
{
ev_stat *w = (ev_stat *)(((char *)w_) - offsetof (ev_stat, timer));
#endif
#if EV_EMBED_ENABLE
-void noinline
+noinline
+void
ev_embed_sweep (EV_P_ ev_embed *w) EV_THROW
{
ev_run (w->other, EVRUN_NOWAIT);
/*****************************************************************************/
#if EV_WALK_ENABLE
-void ecb_cold
+ecb_cold
+void
ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)) EV_THROW
{
int i, j;