nio4r 1.2.1-java → 2.0.0-java

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