nio4r 2.0.0.pre → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +0 -1
  3. data/.rubocop.yml +31 -38
  4. data/.ruby-version +1 -0
  5. data/.travis.yml +4 -21
  6. data/CHANGES.md +75 -42
  7. data/Gemfile +11 -3
  8. data/Guardfile +10 -0
  9. data/LICENSE.txt +1 -1
  10. data/README.md +32 -136
  11. data/Rakefile +2 -0
  12. data/examples/echo_server.rb +1 -0
  13. data/ext/libev/Changes +4 -13
  14. data/ext/libev/ev.c +100 -74
  15. data/ext/libev/ev.h +3 -3
  16. data/ext/libev/ev_epoll.c +6 -3
  17. data/ext/libev/ev_kqueue.c +8 -4
  18. data/ext/libev/ev_poll.c +6 -3
  19. data/ext/libev/ev_port.c +8 -4
  20. data/ext/libev/ev_select.c +4 -2
  21. data/ext/nio4r/bytebuffer.c +265 -257
  22. data/ext/nio4r/extconf.rb +2 -10
  23. data/ext/nio4r/monitor.c +93 -46
  24. data/ext/nio4r/nio4r.h +5 -15
  25. data/ext/nio4r/org/nio4r/ByteBuffer.java +193 -209
  26. data/ext/nio4r/org/nio4r/Monitor.java +164 -0
  27. data/ext/nio4r/org/nio4r/Nio4r.java +13 -391
  28. data/ext/nio4r/org/nio4r/Selector.java +278 -0
  29. data/ext/nio4r/selector.c +52 -52
  30. data/lib/nio.rb +3 -3
  31. data/lib/nio/bytebuffer.rb +179 -132
  32. data/lib/nio/monitor.rb +64 -4
  33. data/lib/nio/selector.rb +36 -13
  34. data/lib/nio/version.rb +1 -1
  35. data/nio4r.gemspec +25 -19
  36. data/spec/nio/acceptables_spec.rb +6 -4
  37. data/spec/nio/bytebuffer_spec.rb +323 -51
  38. data/spec/nio/monitor_spec.rb +122 -79
  39. data/spec/nio/selectables/pipe_spec.rb +5 -1
  40. data/spec/nio/selectables/ssl_socket_spec.rb +15 -12
  41. data/spec/nio/selectables/tcp_socket_spec.rb +42 -31
  42. data/spec/nio/selectables/udp_socket_spec.rb +2 -0
  43. data/spec/nio/selector_spec.rb +10 -4
  44. data/spec/spec_helper.rb +24 -3
  45. data/spec/support/selectable_examples.rb +7 -5
  46. data/tasks/extension.rake +2 -0
  47. data/tasks/rspec.rake +2 -0
  48. data/tasks/rubocop.rake +2 -0
  49. metadata +15 -11
  50. data/.rubocop_todo.yml +0 -35
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require "bundler/gem_tasks"
2
4
  require "rake/clean"
3
5
 
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
4
  $LOAD_PATH.push File.expand_path("../../lib", __FILE__)
4
5
  require "nio"
@@ -1,18 +1,9 @@
1
1
  Revision history for libev, a high-performance and full-featured event loop.
2
2
 
3
- TODO: ev_loop_wakeup
4
- TODO: EV_STANDALONE == NO_HASSEL (do not use clock_gettime in ev_standalone)
5
- TODO: faq, process a thing in each iteration
6
- TODO: dbeugging tips, ev_verify, ev_init twice
7
- TODO: ev_break for immediate exit (EVBREAK_NOW?)
8
- TODO: ev_feed_child_event
9
- TODO: document the special problem of signals around fork.
10
- TODO: store pid for each signal
11
- TODO: document file descriptor usage per loop
12
- TODO: store loop pid_t and compare isndie signal handler,store 1 for same, 2 for differign pid, clean up in loop_fork
13
- TODO: embed watchers need updating when fd changes
14
- TODO: document portability requirements for atomic pointer access
15
- TODO: document requirements for function pointers and calling conventions.
3
+ 4.23 Wed Nov 16 18:23:41 CET 2016
4
+ - move some declarations at the beginning to help certain retarded
5
+ microsoft compilers, even though their documentation claims
6
+ otherwise (reported by Ruslan Osmanov).
16
7
 
17
8
  4.22 Sun Dec 20 22:11:50 CET 2015
18
9
  - when epoll detects unremovable fds in the fd set, rebuild
@@ -1534,7 +1534,7 @@ ecb_binary32_to_binary16 (uint32_t x)
1534
1534
  #if EV_FEATURE_CODE
1535
1535
  # define inline_speed ecb_inline
1536
1536
  #else
1537
- # define inline_speed static noinline
1537
+ # define inline_speed noinline static
1538
1538
  #endif
1539
1539
 
1540
1540
  #define NUMPRI (EV_MAXPRI - EV_MINPRI + 1)
@@ -1591,7 +1591,8 @@ static EV_ATOMIC_T have_monotonic; /* did clock_gettime (CLOCK_MONOTONIC) work?
1591
1591
  #include <float.h>
1592
1592
 
1593
1593
  /* a floor() replacement function, should be independent of ev_tstamp type */
1594
- static ev_tstamp noinline
1594
+ noinline
1595
+ static ev_tstamp
1595
1596
  ev_floor (ev_tstamp v)
1596
1597
  {
1597
1598
  /* the choice of shift factor is not terribly important */
@@ -1633,7 +1634,8 @@ ev_floor (ev_tstamp v)
1633
1634
  # include <sys/utsname.h>
1634
1635
  #endif
1635
1636
 
1636
- static unsigned int noinline ecb_cold
1637
+ noinline ecb_cold
1638
+ static unsigned int
1637
1639
  ev_linux_version (void)
1638
1640
  {
1639
1641
  #ifdef __linux
@@ -1672,7 +1674,8 @@ ev_linux_version (void)
1672
1674
  /*****************************************************************************/
1673
1675
 
1674
1676
  #if EV_AVOID_STDIO
1675
- static void noinline ecb_cold
1677
+ noinline ecb_cold
1678
+ static void
1676
1679
  ev_printerr (const char *msg)
1677
1680
  {
1678
1681
  write (STDERR_FILENO, msg, strlen (msg));
@@ -1681,13 +1684,15 @@ ev_printerr (const char *msg)
1681
1684
 
1682
1685
  static void (*syserr_cb)(const char *msg) EV_THROW;
1683
1686
 
1684
- void ecb_cold
1687
+ ecb_cold
1688
+ void
1685
1689
  ev_set_syserr_cb (void (*cb)(const char *msg) EV_THROW) EV_THROW
1686
1690
  {
1687
1691
  syserr_cb = cb;
1688
1692
  }
1689
1693
 
1690
- static void noinline ecb_cold
1694
+ noinline ecb_cold
1695
+ static void
1691
1696
  ev_syserr (const char *msg)
1692
1697
  {
1693
1698
  if (!msg)
@@ -1728,7 +1733,8 @@ ev_realloc_emul (void *ptr, long size) EV_THROW
1728
1733
 
1729
1734
  static void *(*alloc)(void *ptr, long size) EV_THROW = ev_realloc_emul;
1730
1735
 
1731
- void ecb_cold
1736
+ ecb_cold
1737
+ void
1732
1738
  ev_set_allocator (void *(*cb)(void *ptr, long size) EV_THROW) EV_THROW
1733
1739
  {
1734
1740
  alloc = cb;
@@ -1947,7 +1953,8 @@ array_nextsize (int elem, int cur, int cnt)
1947
1953
  return ncur;
1948
1954
  }
1949
1955
 
1950
- static void * noinline ecb_cold
1956
+ noinline ecb_cold
1957
+ static void *
1951
1958
  array_realloc (int elem, void *base, int *cur, int cnt)
1952
1959
  {
1953
1960
  *cur = array_nextsize (elem, *cur, cnt);
@@ -1960,7 +1967,7 @@ array_realloc (int elem, void *base, int *cur, int cnt)
1960
1967
  #define array_needsize(type,base,cur,cnt,init) \
1961
1968
  if (expect_false ((cnt) > (cur))) \
1962
1969
  { \
1963
- int ecb_unused ocur_ = (cur); \
1970
+ ecb_unused int ocur_ = (cur); \
1964
1971
  (base) = (type *)array_realloc \
1965
1972
  (sizeof (type), (base), &(cur), (cnt)); \
1966
1973
  init ((base) + (ocur_), (cur) - ocur_); \
@@ -1982,12 +1989,14 @@ array_realloc (int elem, void *base, int *cur, int cnt)
1982
1989
  /*****************************************************************************/
1983
1990
 
1984
1991
  /* dummy callback for pending events */
1985
- static void noinline
1992
+ noinline
1993
+ static void
1986
1994
  pendingcb (EV_P_ ev_prepare *w, int revents)
1987
1995
  {
1988
1996
  }
1989
1997
 
1990
- void noinline
1998
+ noinline
1999
+ void
1991
2000
  ev_feed_event (EV_P_ void *w, int revents) EV_THROW
1992
2001
  {
1993
2002
  W w_ = (W)w;
@@ -2127,7 +2136,8 @@ fd_reify (EV_P)
2127
2136
  }
2128
2137
 
2129
2138
  /* something about the given fd changed */
2130
- inline_size void
2139
+ inline_size
2140
+ void
2131
2141
  fd_change (EV_P_ int fd, int flags)
2132
2142
  {
2133
2143
  unsigned char reify = anfds [fd].reify;
@@ -2142,7 +2152,7 @@ fd_change (EV_P_ int fd, int flags)
2142
2152
  }
2143
2153
 
2144
2154
  /* the given fd is invalid/unusable, so make sure it doesn't hurt us anymore */
2145
- inline_speed void ecb_cold
2155
+ inline_speed ecb_cold void
2146
2156
  fd_kill (EV_P_ int fd)
2147
2157
  {
2148
2158
  ev_io *w;
@@ -2155,7 +2165,7 @@ fd_kill (EV_P_ int fd)
2155
2165
  }
2156
2166
 
2157
2167
  /* check whether the given fd is actually valid, for error recovery */
2158
- inline_size int ecb_cold
2168
+ inline_size ecb_cold int
2159
2169
  fd_valid (int fd)
2160
2170
  {
2161
2171
  #ifdef _WIN32
@@ -2166,7 +2176,8 @@ fd_valid (int fd)
2166
2176
  }
2167
2177
 
2168
2178
  /* called on EBADF to verify fds */
2169
- static void noinline ecb_cold
2179
+ noinline ecb_cold
2180
+ static void
2170
2181
  fd_ebadf (EV_P)
2171
2182
  {
2172
2183
  int fd;
@@ -2178,7 +2189,8 @@ fd_ebadf (EV_P)
2178
2189
  }
2179
2190
 
2180
2191
  /* called on ENOMEM in select/poll to kill some fds and retry */
2181
- static void noinline ecb_cold
2192
+ noinline ecb_cold
2193
+ static void
2182
2194
  fd_enomem (EV_P)
2183
2195
  {
2184
2196
  int fd;
@@ -2192,7 +2204,8 @@ fd_enomem (EV_P)
2192
2204
  }
2193
2205
 
2194
2206
  /* usually called after fork if backend needs to re-arm all fds from scratch */
2195
- static void noinline
2207
+ noinline
2208
+ static void
2196
2209
  fd_rearm_all (EV_P)
2197
2210
  {
2198
2211
  int fd;
@@ -2383,7 +2396,8 @@ static ANSIG signals [EV_NSIG - 1];
2383
2396
 
2384
2397
  #if EV_SIGNAL_ENABLE || EV_ASYNC_ENABLE
2385
2398
 
2386
- static void noinline ecb_cold
2399
+ noinline ecb_cold
2400
+ static void
2387
2401
  evpipe_init (EV_P)
2388
2402
  {
2389
2403
  if (!ev_is_active (&pipe_w))
@@ -2571,7 +2585,8 @@ ev_sighandler (int signum)
2571
2585
  ev_feed_signal (signum);
2572
2586
  }
2573
2587
 
2574
- void noinline
2588
+ noinline
2589
+ void
2575
2590
  ev_feed_signal_event (EV_P_ int signum) EV_THROW
2576
2591
  {
2577
2592
  WL w;
@@ -2698,20 +2713,20 @@ childcb (EV_P_ ev_signal *sw, int revents)
2698
2713
  # include "ev_select.c"
2699
2714
  #endif
2700
2715
 
2701
- int ecb_cold
2716
+ ecb_cold int
2702
2717
  ev_version_major (void) EV_THROW
2703
2718
  {
2704
2719
  return EV_VERSION_MAJOR;
2705
2720
  }
2706
2721
 
2707
- int ecb_cold
2722
+ ecb_cold int
2708
2723
  ev_version_minor (void) EV_THROW
2709
2724
  {
2710
2725
  return EV_VERSION_MINOR;
2711
2726
  }
2712
2727
 
2713
2728
  /* return true if we are running with elevated privileges and should ignore env variables */
2714
- int inline_size ecb_cold
2729
+ inline_size ecb_cold int
2715
2730
  enable_secure (void)
2716
2731
  {
2717
2732
  #ifdef _WIN32
@@ -2722,7 +2737,8 @@ enable_secure (void)
2722
2737
  #endif
2723
2738
  }
2724
2739
 
2725
- unsigned int ecb_cold
2740
+ ecb_cold
2741
+ unsigned int
2726
2742
  ev_supported_backends (void) EV_THROW
2727
2743
  {
2728
2744
  unsigned int flags = 0;
@@ -2736,7 +2752,8 @@ ev_supported_backends (void) EV_THROW
2736
2752
  return flags;
2737
2753
  }
2738
2754
 
2739
- unsigned int ecb_cold
2755
+ ecb_cold
2756
+ unsigned int
2740
2757
  ev_recommended_backends (void) EV_THROW
2741
2758
  {
2742
2759
  unsigned int flags = ev_supported_backends ();
@@ -2758,7 +2775,8 @@ ev_recommended_backends (void) EV_THROW
2758
2775
  return flags;
2759
2776
  }
2760
2777
 
2761
- unsigned int ecb_cold
2778
+ ecb_cold
2779
+ unsigned int
2762
2780
  ev_embeddable_backends (void) EV_THROW
2763
2781
  {
2764
2782
  int flags = EVBACKEND_EPOLL | EVBACKEND_KQUEUE | EVBACKEND_PORT;
@@ -2828,7 +2846,8 @@ ev_set_loop_release_cb (EV_P_ void (*release)(EV_P) EV_THROW, void (*acquire)(EV
2828
2846
  #endif
2829
2847
 
2830
2848
  /* initialise a loop structure, must be zero-initialised */
2831
- static void noinline ecb_cold
2849
+ noinline ecb_cold
2850
+ static void
2832
2851
  loop_init (EV_P_ unsigned int flags) EV_THROW
2833
2852
  {
2834
2853
  if (!backend)
@@ -2925,7 +2944,8 @@ loop_init (EV_P_ unsigned int flags) EV_THROW
2925
2944
  }
2926
2945
 
2927
2946
  /* free up a loop structure */
2928
- void ecb_cold
2947
+ ecb_cold
2948
+ void
2929
2949
  ev_loop_destroy (EV_P)
2930
2950
  {
2931
2951
  int i;
@@ -3077,7 +3097,8 @@ loop_fork (EV_P)
3077
3097
 
3078
3098
  #if EV_MULTIPLICITY
3079
3099
 
3080
- struct ev_loop * ecb_cold
3100
+ ecb_cold
3101
+ struct ev_loop *
3081
3102
  ev_loop_new (unsigned int flags) EV_THROW
3082
3103
  {
3083
3104
  EV_P = (struct ev_loop *)ev_malloc (sizeof (struct ev_loop));
@@ -3095,7 +3116,8 @@ ev_loop_new (unsigned int flags) EV_THROW
3095
3116
  #endif /* multiplicity */
3096
3117
 
3097
3118
  #if EV_VERIFY
3098
- static void noinline ecb_cold
3119
+ noinline ecb_cold
3120
+ static void
3099
3121
  verify_watcher (EV_P_ W w)
3100
3122
  {
3101
3123
  assert (("libev: watcher has invalid priority", ABSPRI (w) >= 0 && ABSPRI (w) < NUMPRI));
@@ -3104,7 +3126,8 @@ verify_watcher (EV_P_ W w)
3104
3126
  assert (("libev: pending watcher not on pending queue", pendings [ABSPRI (w)][w->pending - 1].w == w));
3105
3127
  }
3106
3128
 
3107
- static void noinline ecb_cold
3129
+ noinline ecb_cold
3130
+ static void
3108
3131
  verify_heap (EV_P_ ANHE *heap, int N)
3109
3132
  {
3110
3133
  int i;
@@ -3119,7 +3142,8 @@ verify_heap (EV_P_ ANHE *heap, int N)
3119
3142
  }
3120
3143
  }
3121
3144
 
3122
- static void noinline ecb_cold
3145
+ noinline ecb_cold
3146
+ static void
3123
3147
  array_verify (EV_P_ W *ws, int cnt)
3124
3148
  {
3125
3149
  while (cnt--)
@@ -3218,7 +3242,8 @@ ev_verify (EV_P) EV_THROW
3218
3242
  #endif
3219
3243
 
3220
3244
  #if EV_MULTIPLICITY
3221
- struct ev_loop * ecb_cold
3245
+ ecb_cold
3246
+ struct ev_loop *
3222
3247
  #else
3223
3248
  int
3224
3249
  #endif
@@ -3276,7 +3301,8 @@ ev_pending_count (EV_P) EV_THROW
3276
3301
  return count;
3277
3302
  }
3278
3303
 
3279
- void noinline
3304
+ noinline
3305
+ void
3280
3306
  ev_invoke_pending (EV_P)
3281
3307
  {
3282
3308
  pendingpri = NUMPRI;
@@ -3361,7 +3387,8 @@ timers_reify (EV_P)
3361
3387
 
3362
3388
  #if EV_PERIODIC_ENABLE
3363
3389
 
3364
- static void noinline
3390
+ noinline
3391
+ static void
3365
3392
  periodic_recalc (EV_P_ ev_periodic *w)
3366
3393
  {
3367
3394
  ev_tstamp interval = w->interval > MIN_INTERVAL ? w->interval : MIN_INTERVAL;
@@ -3429,7 +3456,8 @@ periodics_reify (EV_P)
3429
3456
 
3430
3457
  /* simply recalculate all periodics */
3431
3458
  /* TODO: maybe ensure that at least one event happens when jumping forward? */
3432
- static void noinline ecb_cold
3459
+ noinline ecb_cold
3460
+ static void
3433
3461
  periodics_reschedule (EV_P)
3434
3462
  {
3435
3463
  int i;
@@ -3452,7 +3480,8 @@ periodics_reschedule (EV_P)
3452
3480
  #endif
3453
3481
 
3454
3482
  /* adjust all timers by a given offset */
3455
- static void noinline ecb_cold
3483
+ noinline ecb_cold
3484
+ static void
3456
3485
  timers_reschedule (EV_P_ ev_tstamp adjust)
3457
3486
  {
3458
3487
  int i;
@@ -3537,7 +3566,6 @@ time_update (EV_P_ ev_tstamp max_block)
3537
3566
  }
3538
3567
 
3539
3568
  /* ########## NIO4R PATCHERY HO! ########## */
3540
- #if defined(HAVE_RB_THREAD_BLOCKING_REGION) || defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL)
3541
3569
  struct ev_poll_args {
3542
3570
  struct ev_loop *loop;
3543
3571
  ev_tstamp waittime;
@@ -3550,16 +3578,13 @@ VALUE ev_backend_poll(void *ptr)
3550
3578
  struct ev_loop *loop = args->loop;
3551
3579
  backend_poll (EV_A_ args->waittime);
3552
3580
  }
3553
- #endif
3554
3581
  /* ######################################## */
3555
3582
 
3556
3583
  int
3557
3584
  ev_run (EV_P_ int flags)
3558
3585
  {
3559
3586
  /* ########## NIO4R PATCHERY HO! ########## */
3560
- #if defined(HAVE_RB_THREAD_BLOCKING_REGION) || defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL)
3561
3587
  struct ev_poll_args poll_args;
3562
- #endif
3563
3588
  /* ######################################## */
3564
3589
 
3565
3590
  #if EV_FEATURE_API
@@ -3720,25 +3745,9 @@ rb_thread_unsafe_dangerous_crazy_blocking_region_end(...);
3720
3745
  #######################################################################
3721
3746
  */
3722
3747
 
3723
- /*
3724
- simulate to rb_thread_call_without_gvl using rb_theread_blocking_region.
3725
- https://github.com/brianmario/mysql2/blob/master/ext/mysql2/client.h#L8
3726
- */
3727
-
3728
- #ifndef HAVE_RB_THREAD_CALL_WITHOUT_GVL
3729
- #ifdef HAVE_RB_THREAD_BLOCKING_REGION
3730
- #define rb_thread_call_without_gvl(func, data1, ubf, data2) \
3731
- rb_thread_blocking_region((rb_blocking_function_t *)func, data1, ubf, data2)
3732
- #endif
3733
- #endif
3734
-
3735
- #if defined(HAVE_RB_THREAD_BLOCKING_REGION) || defined(HAVE_RB_THREAD_CALL_WITHOUT_GVL)
3736
3748
  poll_args.loop = loop;
3737
3749
  poll_args.waittime = waittime;
3738
3750
  rb_thread_call_without_gvl(ev_backend_poll, (void *)&poll_args, RUBY_UBF_IO, 0);
3739
- #else
3740
- backend_poll (EV_A_ waittime);
3741
- #endif
3742
3751
  /*
3743
3752
  ############################# END PATCHERY ############################
3744
3753
  */
@@ -3916,7 +3925,8 @@ ev_stop (EV_P_ W w)
3916
3925
 
3917
3926
  /*****************************************************************************/
3918
3927
 
3919
- void noinline
3928
+ noinline
3929
+ void
3920
3930
  ev_io_start (EV_P_ ev_io *w) EV_THROW
3921
3931
  {
3922
3932
  int fd = w->fd;
@@ -3942,7 +3952,8 @@ ev_io_start (EV_P_ ev_io *w) EV_THROW
3942
3952
  EV_FREQUENT_CHECK;
3943
3953
  }
3944
3954
 
3945
- void noinline
3955
+ noinline
3956
+ void
3946
3957
  ev_io_stop (EV_P_ ev_io *w) EV_THROW
3947
3958
  {
3948
3959
  clear_pending (EV_A_ (W)w);
@@ -3961,7 +3972,8 @@ ev_io_stop (EV_P_ ev_io *w) EV_THROW
3961
3972
  EV_FREQUENT_CHECK;
3962
3973
  }
3963
3974
 
3964
- void noinline
3975
+ noinline
3976
+ void
3965
3977
  ev_timer_start (EV_P_ ev_timer *w) EV_THROW
3966
3978
  {
3967
3979
  if (expect_false (ev_is_active (w)))
@@ -3985,7 +3997,8 @@ ev_timer_start (EV_P_ ev_timer *w) EV_THROW
3985
3997
  /*assert (("libev: internal timer heap corruption", timers [ev_active (w)] == (WT)w));*/
3986
3998
  }
3987
3999
 
3988
- void noinline
4000
+ noinline
4001
+ void
3989
4002
  ev_timer_stop (EV_P_ ev_timer *w) EV_THROW
3990
4003
  {
3991
4004
  clear_pending (EV_A_ (W)w);
@@ -4015,7 +4028,8 @@ ev_timer_stop (EV_P_ ev_timer *w) EV_THROW
4015
4028
  EV_FREQUENT_CHECK;
4016
4029
  }
4017
4030
 
4018
- void noinline
4031
+ noinline
4032
+ void
4019
4033
  ev_timer_again (EV_P_ ev_timer *w) EV_THROW
4020
4034
  {
4021
4035
  EV_FREQUENT_CHECK;
@@ -4049,7 +4063,8 @@ ev_timer_remaining (EV_P_ ev_timer *w) EV_THROW
4049
4063
  }
4050
4064
 
4051
4065
  #if EV_PERIODIC_ENABLE
4052
- void noinline
4066
+ noinline
4067
+ void
4053
4068
  ev_periodic_start (EV_P_ ev_periodic *w) EV_THROW
4054
4069
  {
4055
4070
  if (expect_false (ev_is_active (w)))
@@ -4079,7 +4094,8 @@ ev_periodic_start (EV_P_ ev_periodic *w) EV_THROW
4079
4094
  /*assert (("libev: internal periodic heap corruption", ANHE_w (periodics [ev_active (w)]) == (WT)w));*/
4080
4095
  }
4081
4096
 
4082
- void noinline
4097
+ noinline
4098
+ void
4083
4099
  ev_periodic_stop (EV_P_ ev_periodic *w) EV_THROW
4084
4100
  {
4085
4101
  clear_pending (EV_A_ (W)w);
@@ -4107,7 +4123,8 @@ ev_periodic_stop (EV_P_ ev_periodic *w) EV_THROW
4107
4123
  EV_FREQUENT_CHECK;
4108
4124
  }
4109
4125
 
4110
- void noinline
4126
+ noinline
4127
+ void
4111
4128
  ev_periodic_again (EV_P_ ev_periodic *w) EV_THROW
4112
4129
  {
4113
4130
  /* TODO: use adjustheap and recalculation */
@@ -4122,7 +4139,8 @@ ev_periodic_again (EV_P_ ev_periodic *w) EV_THROW
4122
4139
 
4123
4140
  #if EV_SIGNAL_ENABLE
4124
4141
 
4125
- void noinline
4142
+ noinline
4143
+ void
4126
4144
  ev_signal_start (EV_P_ ev_signal *w) EV_THROW
4127
4145
  {
4128
4146
  if (expect_false (ev_is_active (w)))
@@ -4204,7 +4222,8 @@ ev_signal_start (EV_P_ ev_signal *w) EV_THROW
4204
4222
  EV_FREQUENT_CHECK;
4205
4223
  }
4206
4224
 
4207
- void noinline
4225
+ noinline
4226
+ void
4208
4227
  ev_signal_stop (EV_P_ ev_signal *w) EV_THROW
4209
4228
  {
4210
4229
  clear_pending (EV_A_ (W)w);
@@ -4290,14 +4309,15 @@ ev_child_stop (EV_P_ ev_child *w) EV_THROW
4290
4309
  #define NFS_STAT_INTERVAL 30.1074891 /* for filesystems potentially failing inotify */
4291
4310
  #define MIN_STAT_INTERVAL 0.1074891
4292
4311
 
4293
- static void noinline stat_timer_cb (EV_P_ ev_timer *w_, int revents);
4312
+ noinline static void stat_timer_cb (EV_P_ ev_timer *w_, int revents);
4294
4313
 
4295
4314
  #if EV_USE_INOTIFY
4296
4315
 
4297
4316
  /* the * 2 is to allow for alignment padding, which for some reason is >> 8 */
4298
4317
  # define EV_INOTIFY_BUFSIZE (sizeof (struct inotify_event) * 2 + NAME_MAX)
4299
4318
 
4300
- static void noinline
4319
+ noinline
4320
+ static void
4301
4321
  infy_add (EV_P_ ev_stat *w)
4302
4322
  {
4303
4323
  w->wd = inotify_add_watch (fs_fd, w->path,
@@ -4371,7 +4391,8 @@ infy_add (EV_P_ ev_stat *w)
4371
4391
  if (ev_is_active (&w->timer)) ev_unref (EV_A);
4372
4392
  }
4373
4393
 
4374
- static void noinline
4394
+ noinline
4395
+ static void
4375
4396
  infy_del (EV_P_ ev_stat *w)
4376
4397
  {
4377
4398
  int slot;
@@ -4388,7 +4409,8 @@ infy_del (EV_P_ ev_stat *w)
4388
4409
  inotify_rm_watch (fs_fd, wd);
4389
4410
  }
4390
4411
 
4391
- static void noinline
4412
+ noinline
4413
+ static void
4392
4414
  infy_wd (EV_P_ int slot, int wd, struct inotify_event *ev)
4393
4415
  {
4394
4416
  if (slot < 0)
@@ -4434,7 +4456,8 @@ infy_cb (EV_P_ ev_io *w, int revents)
4434
4456
  }
4435
4457
  }
4436
4458
 
4437
- inline_size void ecb_cold
4459
+ inline_size ecb_cold
4460
+ void
4438
4461
  ev_check_2625 (EV_P)
4439
4462
  {
4440
4463
  /* kernels < 2.6.25 are borked
@@ -4542,7 +4565,8 @@ ev_stat_stat (EV_P_ ev_stat *w) EV_THROW
4542
4565
  w->attr.st_nlink = 1;
4543
4566
  }
4544
4567
 
4545
- static void noinline
4568
+ noinline
4569
+ static void
4546
4570
  stat_timer_cb (EV_P_ ev_timer *w_, int revents)
4547
4571
  {
4548
4572
  ev_stat *w = (ev_stat *)(((char *)w_) - offsetof (ev_stat, timer));
@@ -4762,7 +4786,8 @@ ev_check_stop (EV_P_ ev_check *w) EV_THROW
4762
4786
  #endif
4763
4787
 
4764
4788
  #if EV_EMBED_ENABLE
4765
- void noinline
4789
+ noinline
4790
+ void
4766
4791
  ev_embed_sweep (EV_P_ ev_embed *w) EV_THROW
4767
4792
  {
4768
4793
  ev_run (w->other, EVRUN_NOWAIT);
@@ -5069,7 +5094,8 @@ ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, vo
5069
5094
  /*****************************************************************************/
5070
5095
 
5071
5096
  #if EV_WALK_ENABLE
5072
- void ecb_cold
5097
+ ecb_cold
5098
+ void
5073
5099
  ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)) EV_THROW
5074
5100
  {
5075
5101
  int i, j;