cool.io 1.4.5-x64-mingw32 → 1.7.1-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0b814136c011b681edf8898e6f012f01ae786ac3
4
- data.tar.gz: 1e5e59443945f625eb08a74a1d49fe3441409234
2
+ SHA256:
3
+ metadata.gz: b5e1a160cb7e3699f7f8b1ce5500b82d36eb4669d5706ce9796b247a580bc416
4
+ data.tar.gz: e27152d9bab4b2de877bffba60c334cc4bfe9e495ddd8ac128e2b8236dfde78a
5
5
  SHA512:
6
- metadata.gz: 41d1070f6e1d37ca81dd27f9888486555d3d40c9db0108a6f55532b68ff78392eb4db5be12956f7c8bb952f35c1e6744487aa5f7fb78ff9ea356f444ad720694
7
- data.tar.gz: 4d565001c463b190c22c88e39febecd54aef922536ce5e8ad0fbac99ceaf64d021754b4675342f845149a4cc4bec6b67f41639027f0a4dcea1e914bdf4b026c3
6
+ metadata.gz: 6fa1b5794b29a7fa1a1ffa503376b15ec24be3369a3101685fd48de6d514a29dbc687e67235d45a25ec1a7a71f8efe4a99a0d14503af39d7c5aceb941b2f2cda
7
+ data.tar.gz: 3fc94a1d9e9b222340b0ba8ea53fa9cd36467737a8d7c0c1945ff2eb97061462d79522198b0295024f2d5836d9f1168b98782f339c5ee419511349443ee4727b
data/.travis.yml CHANGED
@@ -3,11 +3,10 @@ language: ruby
3
3
  sudo: false
4
4
 
5
5
  rvm:
6
- - 1.9.3
7
- - 2.0
8
- - 2.1
9
- - 2.2
10
- - 2.3.0
6
+ - 2.4.10
7
+ - 2.5
8
+ - 2.6
9
+ - 2.7
11
10
  - ruby-head
12
11
  - rbx
13
12
 
data/CHANGES.md CHANGED
@@ -1,4 +1,55 @@
1
- 1.4.5
1
+ 1.7.1
2
+ -----
3
+
4
+ * Set fallback local loopback address by default for Windows environment
5
+
6
+ 1.7.0
7
+ -----
8
+
9
+ * Fix extension build failure for ruby3
10
+
11
+ 1.6.1
12
+ -----
13
+
14
+ * Fix warning for recent compilers
15
+
16
+ 1.6.0
17
+ -----
18
+
19
+ * Add ruby 2.6/2.7 to windows gem
20
+ * Drop ruby 2.1/2.2/2.3 from windows gem
21
+
22
+ 1.5.4
23
+ -----
24
+
25
+ * Add ruby 2.5 to windows gem
26
+
27
+ 1.5.3
28
+ -----
29
+
30
+ * Fix invalid IOWatcher's rb_funcall that causes ArgumentError with ruby 2.5 and clang
31
+
32
+ 1.5.2
33
+ -----
34
+
35
+ * Fix invalid TimerWatcher's rb_funcall that causes ArgumentError with ruby 2.5 and clang
36
+
37
+ 1.5.1
38
+ -----
39
+
40
+ * Don't raise an exception when peername failed
41
+
42
+ 1.5.0
43
+ -----
44
+
45
+ * Update libev to 4.24
46
+
47
+ 1.4.6
48
+ -----
49
+
50
+ * Add ruby 2.4.0 to windows binary gem
51
+
52
+ 1.4.5
2
53
  -----
3
54
 
4
55
  * Increase FD_SETSIZE to 1024 on Windows
data/Rakefile CHANGED
@@ -48,8 +48,7 @@ namespace :build do
48
48
  task :windows do
49
49
  require 'rake_compiler_dock'
50
50
  RakeCompilerDock.sh <<-CROSS
51
- bundle
52
- rake cross native gem RUBY_CC_VERSION='2.0.0:2.1.6:2.2.2:2.3.0'
51
+ bundle && bundle exec rake cross native gem RUBY_CC_VERSION='2.7.0:2.6.0:2.5.0:2.4.0'
53
52
  CROSS
54
53
  end
55
54
  end
data/cool.io.gemspec CHANGED
@@ -11,14 +11,15 @@ Gem::Specification.new do |s|
11
11
  s.summary = "A cool framework for doing high performance I/O in Ruby"
12
12
  s.description = "Cool.io provides a high performance event framework for Ruby which uses the libev C library"
13
13
  s.extensions = ["ext/cool.io/extconf.rb", "ext/iobuffer/extconf.rb"]
14
+ s.licenses = ["MIT"]
14
15
 
15
16
  s.files = `git ls-files`.split("\n")
16
17
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
17
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
18
19
  s.require_paths = ["lib"]
19
20
 
20
- s.add_development_dependency "rake-compiler", "~> 0.9.5"
21
- s.add_development_dependency "rake-compiler-dock", "~> 0.5.1"
21
+ s.add_development_dependency "rake-compiler", "~> 1.0"
22
+ s.add_development_dependency "rake-compiler-dock", "~> 1.0"
22
23
  s.add_development_dependency "rspec", ">= 2.13.0"
23
24
  s.add_development_dependency "rdoc", ">= 3.6.0"
24
25
  end
@@ -8,7 +8,11 @@
8
8
  #define COOLIO_H
9
9
 
10
10
  #include "ruby.h"
11
+ #if defined(HAVE_RUBY_IO_H)
12
+ #include "ruby/io.h"
13
+ #else
11
14
  #include "rubyio.h"
15
+ #endif
12
16
 
13
17
  #ifdef GetReadFile
14
18
  #define FPTR_TO_FD(fptr) (fileno(GetReadFile(fptr)))
@@ -56,4 +60,11 @@ struct Coolio_Watcher
56
60
 
57
61
  void Coolio_Loop_process_event(VALUE watcher, int revents);
58
62
 
63
+ void Init_coolio_loop();
64
+ void Init_coolio_watcher();
65
+ void Init_coolio_iowatcher();
66
+ void Init_coolio_timer_watcher();
67
+ void Init_coolio_stat_watcher();
68
+ void Init_coolio_utils();
69
+
59
70
  #endif
@@ -10,6 +10,14 @@ have_func('rb_thread_alone')
10
10
  have_func('rb_str_set_len')
11
11
  have_library('rt', 'clock_gettime')
12
12
 
13
+ if have_header('ruby/io.h')
14
+ $defs << '-DHAVE_RUBY_IO_H'
15
+ end
16
+
17
+ if have_header('ruby/thread.h')
18
+ $defs << '-DHAVE_RUBY_THREAD_H'
19
+ end
20
+
13
21
  if have_header('sys/select.h')
14
22
  $defs << '-DEV_USE_SELECT'
15
23
  end
@@ -5,7 +5,11 @@
5
5
  */
6
6
 
7
7
  #include "ruby.h"
8
+ #if defined(HAVE_RUBY_IO_H)
9
+ #include "ruby/io.h"
10
+ #else
8
11
  #include "rubyio.h"
12
+ #endif
9
13
 
10
14
  #include "ev_wrap.h"
11
15
 
@@ -181,9 +185,9 @@ static void Coolio_IOWatcher_libev_callback(struct ev_loop *ev_loop, struct ev_i
181
185
  static void Coolio_IOWatcher_dispatch_callback(VALUE self, int revents)
182
186
  {
183
187
  if(revents & EV_READ)
184
- rb_funcall(self, rb_intern("on_readable"), 0, 0);
188
+ rb_funcall(self, rb_intern("on_readable"), 0);
185
189
  else if(revents & EV_WRITE)
186
- rb_funcall(self, rb_intern("on_writable"), 0, 0);
190
+ rb_funcall(self, rb_intern("on_writable"), 0);
187
191
  else
188
192
  rb_raise(rb_eRuntimeError, "unknown revents value for ev_io: %d", revents);
189
193
  }
data/ext/cool.io/loop.c CHANGED
@@ -6,7 +6,6 @@
6
6
 
7
7
  #include <assert.h>
8
8
  #include "ruby.h"
9
- #include "rubysig.h"
10
9
  #include "ev_wrap.h"
11
10
 
12
11
  #include "cool.io.h"
@@ -213,7 +213,7 @@ static void Coolio_TimerWatcher_libev_callback(struct ev_loop *ev_loop, struct e
213
213
  static void Coolio_TimerWatcher_dispatch_callback(VALUE self, int revents)
214
214
  {
215
215
  if(revents & EV_TIMEOUT)
216
- rb_funcall(self, rb_intern("on_timer"), 0, 0);
216
+ rb_funcall(self, rb_intern("on_timer"), 0);
217
217
  else
218
218
  rb_raise(rb_eRuntimeError, "unknown revents value for ev_timer: %d", revents);
219
219
  }
data/ext/cool.io/utils.c CHANGED
@@ -15,6 +15,11 @@
15
15
  #include <sys/sysctl.h>
16
16
  #endif
17
17
 
18
+ #ifdef HAVE_SYSCTLBYNAME
19
+ #include <sys/sysctl.h>
20
+ #include <sys/types.h>
21
+ #endif
22
+
18
23
  static VALUE mCoolio = Qnil;
19
24
  static VALUE cCoolio_Utils = Qnil;
20
25
 
@@ -2,8 +2,8 @@ require 'mkmf'
2
2
 
3
3
  dir_config("iobuffer")
4
4
  have_library("c", "main")
5
- if have_macro("HAVE_RB_IO_T", "rubyio.h")
6
- have_struct_member("rb_io_t", "fd", "rubyio.h")
5
+ if have_macro("HAVE_RB_IO_T", "ruby/io.h")
6
+ have_struct_member("rb_io_t", "fd", "ruby/io.h")
7
7
  end
8
8
 
9
9
  create_makefile("iobuffer_ext")
data/ext/libev/Changes CHANGED
@@ -1,19 +1,24 @@
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: possible cb aliasing?
16
- TODO: document requirements for function pointers and calling conventions.
3
+ 4.24 Wed Dec 28 05:19:55 CET 2016
4
+ - bump version to 4.24, as the release tarball inexplicably
5
+ didn't have the right version in ev.h, even though the cvs-tagged
6
+ version did have the right one (reported by Ales Teska).
7
+
8
+ 4.23 Wed Nov 16 18:23:41 CET 2016
9
+ - move some declarations at the beginning to help certain retarded
10
+ microsoft compilers, even though their documentation claims
11
+ otherwise (reported by Ruslan Osmanov).
12
+
13
+ 4.22 Sun Dec 20 22:11:50 CET 2015
14
+ - when epoll detects unremovable fds in the fd set, rebuild
15
+ only the epoll descriptor, not the signal pipe, to avoid
16
+ SIGPIPE in ev_async_send. This doesn't solve it on fork,
17
+ so document what needs to be done in ev_loop_fork
18
+ (analyzed by Benjamin Mahler).
19
+ - remove superfluous sys/timeb.h include on win32
20
+ (analyzed by Jason Madden).
21
+ - updated libecb.
17
22
 
18
23
  4.20 Sat Jun 20 13:01:43 CEST 2015
19
24
  - prefer noexcept over throw () with C++ 11.
@@ -505,3 +510,4 @@ TODO: document requirements for function pointers and calling conventions.
505
510
 
506
511
  0.1 Wed Oct 31 21:31:48 CET 2007
507
512
  - original version; hacked together in <24h.
513
+
data/ext/libev/ev.c CHANGED
@@ -39,6 +39,9 @@
39
39
 
40
40
  /* ########## COOLIO PATCHERY HO! ########## */
41
41
  #include "ruby.h"
42
+ #if defined(HAVE_RUBY_THREAD_H)
43
+ #include "ruby/thread.h"
44
+ #endif
42
45
  /* ######################################## */
43
46
 
44
47
  /* this big block deduces configuration from config.h */
@@ -539,7 +542,7 @@ struct signalfd_siginfo
539
542
  #define ECB_H
540
543
 
541
544
  /* 16 bits major, 16 bits minor */
542
- #define ECB_VERSION 0x00010004
545
+ #define ECB_VERSION 0x00010005
543
546
 
544
547
  #ifdef _WIN32
545
548
  typedef signed char int8_t;
@@ -566,7 +569,7 @@ struct signalfd_siginfo
566
569
  #endif
567
570
  #else
568
571
  #include <inttypes.h>
569
- #if UINTMAX_MAX > 0xffffffffU
572
+ #if (defined INTPTR_MAX ? INTPTR_MAX : ULONG_MAX) > 0xffffffffU
570
573
  #define ECB_PTRSIZE 8
571
574
  #else
572
575
  #define ECB_PTRSIZE 4
@@ -654,6 +657,10 @@ struct signalfd_siginfo
654
657
  #include <builtins.h>
655
658
  #endif
656
659
 
660
+ #if 1400 <= _MSC_VER
661
+ #include <intrin.h> /* fence functions _ReadBarrier, also bit search functions _BitScanReverse */
662
+ #endif
663
+
657
664
  #ifndef ECB_MEMORY_FENCE
658
665
  #if ECB_GCC_VERSION(2,5) || defined __INTEL_COMPILER || (__llvm__ && __GNUC__) || __SUNPRO_C >= 0x5110 || __SUNPRO_CC >= 0x5110
659
666
  #if __i386 || __i386__
@@ -666,15 +673,23 @@ struct signalfd_siginfo
666
673
  #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("")
667
674
  #elif __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__
668
675
  #define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory")
676
+ #elif defined __ARM_ARCH_2__ \
677
+ || defined __ARM_ARCH_3__ || defined __ARM_ARCH_3M__ \
678
+ || defined __ARM_ARCH_4__ || defined __ARM_ARCH_4T__ \
679
+ || defined __ARM_ARCH_5__ || defined __ARM_ARCH_5E__ \
680
+ || defined __ARM_ARCH_5T__ || defined __ARM_ARCH_5TE__ \
681
+ || defined __ARM_ARCH_5TEJ__
682
+ /* should not need any, unless running old code on newer cpu - arm doesn't support that */
669
683
  #elif defined __ARM_ARCH_6__ || defined __ARM_ARCH_6J__ \
670
- || defined __ARM_ARCH_6K__ || defined __ARM_ARCH_6ZK__
684
+ || defined __ARM_ARCH_6K__ || defined __ARM_ARCH_6ZK__ \
685
+ || defined __ARM_ARCH_6T2__
671
686
  #define ECB_MEMORY_FENCE __asm__ __volatile__ ("mcr p15,0,%0,c7,c10,5" : : "r" (0) : "memory")
672
687
  #elif defined __ARM_ARCH_7__ || defined __ARM_ARCH_7A__ \
673
- || defined __ARM_ARCH_7M__ || defined __ARM_ARCH_7R__
688
+ || defined __ARM_ARCH_7R__ || defined __ARM_ARCH_7M__
674
689
  #define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb" : : : "memory")
675
690
  #elif __aarch64__
676
691
  #define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb ish" : : : "memory")
677
- #elif (__sparc || __sparc__) && !__sparcv8
692
+ #elif (__sparc || __sparc__) && !(__sparc_v8__ || defined __sparcv8)
678
693
  #define ECB_MEMORY_FENCE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad | #StoreStore | #StoreLoad" : : : "memory")
679
694
  #define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad" : : : "memory")
680
695
  #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("membar #LoadStore | #StoreStore")
@@ -922,6 +937,11 @@ typedef int ecb_bool;
922
937
  ecb_function_ ecb_const int
923
938
  ecb_ctz32 (uint32_t x)
924
939
  {
940
+ #if 1400 <= _MSC_VER && (_M_IX86 || _M_X64 || _M_IA64 || _M_ARM)
941
+ unsigned long r;
942
+ _BitScanForward (&r, x);
943
+ return (int)r;
944
+ #else
925
945
  int r = 0;
926
946
 
927
947
  x &= ~x + 1; /* this isolates the lowest bit */
@@ -941,14 +961,21 @@ typedef int ecb_bool;
941
961
  #endif
942
962
 
943
963
  return r;
964
+ #endif
944
965
  }
945
966
 
946
967
  ecb_function_ ecb_const int ecb_ctz64 (uint64_t x);
947
968
  ecb_function_ ecb_const int
948
969
  ecb_ctz64 (uint64_t x)
949
970
  {
950
- int shift = x & 0xffffffffU ? 0 : 32;
971
+ #if 1400 <= _MSC_VER && (_M_X64 || _M_IA64 || _M_ARM)
972
+ unsigned long r;
973
+ _BitScanForward64 (&r, x);
974
+ return (int)r;
975
+ #else
976
+ int shift = x & 0xffffffff ? 0 : 32;
951
977
  return ecb_ctz32 (x >> shift) + shift;
978
+ #endif
952
979
  }
953
980
 
954
981
  ecb_function_ ecb_const int ecb_popcount32 (uint32_t x);
@@ -966,6 +993,11 @@ typedef int ecb_bool;
966
993
  ecb_function_ ecb_const int ecb_ld32 (uint32_t x);
967
994
  ecb_function_ ecb_const int ecb_ld32 (uint32_t x)
968
995
  {
996
+ #if 1400 <= _MSC_VER && (_M_IX86 || _M_X64 || _M_IA64 || _M_ARM)
997
+ unsigned long r;
998
+ _BitScanReverse (&r, x);
999
+ return (int)r;
1000
+ #else
969
1001
  int r = 0;
970
1002
 
971
1003
  if (x >> 16) { x >>= 16; r += 16; }
@@ -975,16 +1007,23 @@ typedef int ecb_bool;
975
1007
  if (x >> 1) { r += 1; }
976
1008
 
977
1009
  return r;
1010
+ #endif
978
1011
  }
979
1012
 
980
1013
  ecb_function_ ecb_const int ecb_ld64 (uint64_t x);
981
1014
  ecb_function_ ecb_const int ecb_ld64 (uint64_t x)
982
1015
  {
1016
+ #if 1400 <= _MSC_VER && (_M_X64 || _M_IA64 || _M_ARM)
1017
+ unsigned long r;
1018
+ _BitScanReverse64 (&r, x);
1019
+ return (int)r;
1020
+ #else
983
1021
  int r = 0;
984
1022
 
985
1023
  if (x >> 32) { x >>= 32; r += 32; }
986
1024
 
987
1025
  return r + ecb_ld32 (x);
1026
+ #endif
988
1027
  }
989
1028
  #endif
990
1029
 
@@ -1097,8 +1136,8 @@ ecb_inline ecb_const uint64_t ecb_rotr64 (uint64_t x, unsigned int count) { retu
1097
1136
  /* try to tell the compiler that some condition is definitely true */
1098
1137
  #define ecb_assume(cond) if (!(cond)) ecb_unreachable (); else 0
1099
1138
 
1100
- ecb_inline ecb_const unsigned char ecb_byteorder_helper (void);
1101
- ecb_inline ecb_const unsigned char
1139
+ ecb_inline ecb_const uint32_t ecb_byteorder_helper (void);
1140
+ ecb_inline ecb_const uint32_t
1102
1141
  ecb_byteorder_helper (void)
1103
1142
  {
1104
1143
  /* the union code still generates code under pressure in gcc, */
@@ -1107,26 +1146,28 @@ ecb_byteorder_helper (void)
1107
1146
  /* the reason why we have this horrible preprocessor mess */
1108
1147
  /* is to avoid it in all cases, at least on common architectures */
1109
1148
  /* or when using a recent enough gcc version (>= 4.6) */
1110
- #if ((__i386 || __i386__) && !__VOS__) || _M_IX86 || ECB_GCC_AMD64 || ECB_MSVC_AMD64
1111
- return 0x44;
1112
- #elif __BYTE_ORDER__ && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
1113
- return 0x44;
1114
- #elif __BYTE_ORDER__ && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
1115
- return 0x11;
1149
+ #if (defined __BYTE_ORDER__ && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) \
1150
+ || ((__i386 || __i386__ || _M_IX86 || ECB_GCC_AMD64 || ECB_MSVC_AMD64) && !__VOS__)
1151
+ #define ECB_LITTLE_ENDIAN 1
1152
+ return 0x44332211;
1153
+ #elif (defined __BYTE_ORDER__ && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) \
1154
+ || ((__AARCH64EB__ || __MIPSEB__ || __ARMEB__) && !__VOS__)
1155
+ #define ECB_BIG_ENDIAN 1
1156
+ return 0x11223344;
1116
1157
  #else
1117
1158
  union
1118
1159
  {
1119
- uint32_t i;
1120
- uint8_t c;
1121
- } u = { 0x11223344 };
1122
- return u.c;
1160
+ uint8_t c[4];
1161
+ uint32_t u;
1162
+ } u = { 0x11, 0x22, 0x33, 0x44 };
1163
+ return u.u;
1123
1164
  #endif
1124
1165
  }
1125
1166
 
1126
1167
  ecb_inline ecb_const ecb_bool ecb_big_endian (void);
1127
- ecb_inline ecb_const ecb_bool ecb_big_endian (void) { return ecb_byteorder_helper () == 0x11; }
1168
+ ecb_inline ecb_const ecb_bool ecb_big_endian (void) { return ecb_byteorder_helper () == 0x11223344; }
1128
1169
  ecb_inline ecb_const ecb_bool ecb_little_endian (void);
1129
- ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper () == 0x44; }
1170
+ ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper () == 0x44332211; }
1130
1171
 
1131
1172
  #if ECB_GCC_VERSION(3,0) || ECB_C99
1132
1173
  #define ecb_mod(m,n) ((m) % (n) + ((m) % (n) < 0 ? (n) : 0))
@@ -1161,6 +1202,102 @@ ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_he
1161
1202
  #define ecb_array_length(name) (sizeof (name) / sizeof (name [0]))
1162
1203
  #endif
1163
1204
 
1205
+ ecb_function_ ecb_const uint32_t ecb_binary16_to_binary32 (uint32_t x);
1206
+ ecb_function_ ecb_const uint32_t
1207
+ ecb_binary16_to_binary32 (uint32_t x)
1208
+ {
1209
+ unsigned int s = (x & 0x8000) << (31 - 15);
1210
+ int e = (x >> 10) & 0x001f;
1211
+ unsigned int m = x & 0x03ff;
1212
+
1213
+ if (ecb_expect_false (e == 31))
1214
+ /* infinity or NaN */
1215
+ e = 255 - (127 - 15);
1216
+ else if (ecb_expect_false (!e))
1217
+ {
1218
+ if (ecb_expect_true (!m))
1219
+ /* zero, handled by code below by forcing e to 0 */
1220
+ e = 0 - (127 - 15);
1221
+ else
1222
+ {
1223
+ /* subnormal, renormalise */
1224
+ unsigned int s = 10 - ecb_ld32 (m);
1225
+
1226
+ m = (m << s) & 0x3ff; /* mask implicit bit */
1227
+ e -= s - 1;
1228
+ }
1229
+ }
1230
+
1231
+ /* e and m now are normalised, or zero, (or inf or nan) */
1232
+ e += 127 - 15;
1233
+
1234
+ return s | (e << 23) | (m << (23 - 10));
1235
+ }
1236
+
1237
+ ecb_function_ ecb_const uint16_t ecb_binary32_to_binary16 (uint32_t x);
1238
+ ecb_function_ ecb_const uint16_t
1239
+ ecb_binary32_to_binary16 (uint32_t x)
1240
+ {
1241
+ unsigned int s = (x >> 16) & 0x00008000; /* sign bit, the easy part */
1242
+ unsigned int e = ((x >> 23) & 0x000000ff) - (127 - 15); /* the desired exponent */
1243
+ unsigned int m = x & 0x007fffff;
1244
+
1245
+ x &= 0x7fffffff;
1246
+
1247
+ /* if it's within range of binary16 normals, use fast path */
1248
+ if (ecb_expect_true (0x38800000 <= x && x <= 0x477fefff))
1249
+ {
1250
+ /* mantissa round-to-even */
1251
+ m += 0x00000fff + ((m >> (23 - 10)) & 1);
1252
+
1253
+ /* handle overflow */
1254
+ if (ecb_expect_false (m >= 0x00800000))
1255
+ {
1256
+ m >>= 1;
1257
+ e += 1;
1258
+ }
1259
+
1260
+ return s | (e << 10) | (m >> (23 - 10));
1261
+ }
1262
+
1263
+ /* handle large numbers and infinity */
1264
+ if (ecb_expect_true (0x477fefff < x && x <= 0x7f800000))
1265
+ return s | 0x7c00;
1266
+
1267
+ /* handle zero, subnormals and small numbers */
1268
+ if (ecb_expect_true (x < 0x38800000))
1269
+ {
1270
+ /* zero */
1271
+ if (ecb_expect_true (!x))
1272
+ return s;
1273
+
1274
+ /* handle subnormals */
1275
+
1276
+ /* too small, will be zero */
1277
+ if (e < (14 - 24)) /* might not be sharp, but is good enough */
1278
+ return s;
1279
+
1280
+ m |= 0x00800000; /* make implicit bit explicit */
1281
+
1282
+ /* very tricky - we need to round to the nearest e (+10) bit value */
1283
+ {
1284
+ unsigned int bits = 14 - e;
1285
+ unsigned int half = (1 << (bits - 1)) - 1;
1286
+ unsigned int even = (m >> bits) & 1;
1287
+
1288
+ /* if this overflows, we will end up with a normalised number */
1289
+ m = (m + half + even) >> bits;
1290
+ }
1291
+
1292
+ return s | m;
1293
+ }
1294
+
1295
+ /* handle NaNs, preserve leftmost nan bits, but make sure we don't turn them into infinities */
1296
+ m >>= 13;
1297
+
1298
+ return s | 0x7c00 | m | !m;
1299
+ }
1300
+
1164
1301
  /*******************************************************************************/
1165
1302
  /* floating point stuff, can be disabled by defining ECB_NO_LIBM */
1166
1303
 
@@ -1212,23 +1349,6 @@ ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_he
1212
1349
  #define ecb_frexpf(x,e) (float) frexp ((double) (x), (e))
1213
1350
  #endif
1214
1351
 
1215
- /* converts an ieee half/binary16 to a float */
1216
- ecb_function_ ecb_const float ecb_binary16_to_float (uint16_t x);
1217
- ecb_function_ ecb_const float
1218
- ecb_binary16_to_float (uint16_t x)
1219
- {
1220
- int e = (x >> 10) & 0x1f;
1221
- int m = x & 0x3ff;
1222
- float r;
1223
-
1224
- if (!e ) r = ecb_ldexpf (m , -24);
1225
- else if (e != 31) r = ecb_ldexpf (m + 0x400, e - 25);
1226
- else if (m ) r = ECB_NAN;
1227
- else r = ECB_INFINITY;
1228
-
1229
- return x & 0x8000 ? -r : r;
1230
- }
1231
-
1232
1352
  /* convert a float to ieee single/binary32 */
1233
1353
  ecb_function_ ecb_const uint32_t ecb_float_to_binary32 (float x);
1234
1354
  ecb_function_ ecb_const uint32_t
@@ -1369,6 +1489,22 @@ ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_he
1369
1489
  return r;
1370
1490
  }
1371
1491
 
1492
+ /* convert a float to ieee half/binary16 */
1493
+ ecb_function_ ecb_const uint16_t ecb_float_to_binary16 (float x);
1494
+ ecb_function_ ecb_const uint16_t
1495
+ ecb_float_to_binary16 (float x)
1496
+ {
1497
+ return ecb_binary32_to_binary16 (ecb_float_to_binary32 (x));
1498
+ }
1499
+
1500
+ /* convert an ieee half/binary16 to float */
1501
+ ecb_function_ ecb_const float ecb_binary16_to_float (uint16_t x);
1502
+ ecb_function_ ecb_const float
1503
+ ecb_binary16_to_float (uint16_t x)
1504
+ {
1505
+ return ecb_binary32_to_float (ecb_binary16_to_binary32 (x));
1506
+ }
1507
+
1372
1508
  #endif
1373
1509
 
1374
1510
  #endif
@@ -1401,7 +1537,7 @@ ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_he
1401
1537
  #if EV_FEATURE_CODE
1402
1538
  # define inline_speed ecb_inline
1403
1539
  #else
1404
- # define inline_speed static noinline
1540
+ # define inline_speed noinline static
1405
1541
  #endif
1406
1542
 
1407
1543
  #define NUMPRI (EV_MAXPRI - EV_MINPRI + 1)
@@ -1458,7 +1594,8 @@ static EV_ATOMIC_T have_monotonic; /* did clock_gettime (CLOCK_MONOTONIC) work?
1458
1594
  #include <float.h>
1459
1595
 
1460
1596
  /* a floor() replacement function, should be independent of ev_tstamp type */
1461
- static ev_tstamp noinline
1597
+ noinline
1598
+ static ev_tstamp
1462
1599
  ev_floor (ev_tstamp v)
1463
1600
  {
1464
1601
  /* the choice of shift factor is not terribly important */
@@ -1500,7 +1637,8 @@ ev_floor (ev_tstamp v)
1500
1637
  # include <sys/utsname.h>
1501
1638
  #endif
1502
1639
 
1503
- static unsigned int noinline ecb_cold
1640
+ noinline ecb_cold
1641
+ static unsigned int
1504
1642
  ev_linux_version (void)
1505
1643
  {
1506
1644
  #ifdef __linux
@@ -1539,7 +1677,8 @@ ev_linux_version (void)
1539
1677
  /*****************************************************************************/
1540
1678
 
1541
1679
  #if EV_AVOID_STDIO
1542
- static void noinline ecb_cold
1680
+ noinline ecb_cold
1681
+ static void
1543
1682
  ev_printerr (const char *msg)
1544
1683
  {
1545
1684
  write (STDERR_FILENO, msg, strlen (msg));
@@ -1548,13 +1687,15 @@ ev_printerr (const char *msg)
1548
1687
 
1549
1688
  static void (*syserr_cb)(const char *msg) EV_THROW;
1550
1689
 
1551
- void ecb_cold
1690
+ ecb_cold
1691
+ void
1552
1692
  ev_set_syserr_cb (void (*cb)(const char *msg) EV_THROW) EV_THROW
1553
1693
  {
1554
1694
  syserr_cb = cb;
1555
1695
  }
1556
1696
 
1557
- static void noinline ecb_cold
1697
+ noinline ecb_cold
1698
+ static void
1558
1699
  ev_syserr (const char *msg)
1559
1700
  {
1560
1701
  if (!msg)
@@ -1595,7 +1736,8 @@ ev_realloc_emul (void *ptr, long size) EV_THROW
1595
1736
 
1596
1737
  static void *(*alloc)(void *ptr, long size) EV_THROW = ev_realloc_emul;
1597
1738
 
1598
- void ecb_cold
1739
+ ecb_cold
1740
+ void
1599
1741
  ev_set_allocator (void *(*cb)(void *ptr, long size) EV_THROW) EV_THROW
1600
1742
  {
1601
1743
  alloc = cb;
@@ -1814,7 +1956,8 @@ array_nextsize (int elem, int cur, int cnt)
1814
1956
  return ncur;
1815
1957
  }
1816
1958
 
1817
- static void * noinline ecb_cold
1959
+ noinline ecb_cold
1960
+ static void *
1818
1961
  array_realloc (int elem, void *base, int *cur, int cnt)
1819
1962
  {
1820
1963
  *cur = array_nextsize (elem, *cur, cnt);
@@ -1827,7 +1970,7 @@ array_realloc (int elem, void *base, int *cur, int cnt)
1827
1970
  #define array_needsize(type,base,cur,cnt,init) \
1828
1971
  if (expect_false ((cnt) > (cur))) \
1829
1972
  { \
1830
- int ecb_unused ocur_ = (cur); \
1973
+ ecb_unused int ocur_ = (cur); \
1831
1974
  (base) = (type *)array_realloc \
1832
1975
  (sizeof (type), (base), &(cur), (cnt)); \
1833
1976
  init ((base) + (ocur_), (cur) - ocur_); \
@@ -1849,12 +1992,14 @@ array_realloc (int elem, void *base, int *cur, int cnt)
1849
1992
  /*****************************************************************************/
1850
1993
 
1851
1994
  /* dummy callback for pending events */
1852
- static void noinline
1995
+ noinline
1996
+ static void
1853
1997
  pendingcb (EV_P_ ev_prepare *w, int revents)
1854
1998
  {
1855
1999
  }
1856
2000
 
1857
- void noinline
2001
+ noinline
2002
+ void
1858
2003
  ev_feed_event (EV_P_ void *w, int revents) EV_THROW
1859
2004
  {
1860
2005
  W w_ = (W)w;
@@ -1994,7 +2139,8 @@ fd_reify (EV_P)
1994
2139
  }
1995
2140
 
1996
2141
  /* something about the given fd changed */
1997
- inline_size void
2142
+ inline_size
2143
+ void
1998
2144
  fd_change (EV_P_ int fd, int flags)
1999
2145
  {
2000
2146
  unsigned char reify = anfds [fd].reify;
@@ -2009,7 +2155,7 @@ fd_change (EV_P_ int fd, int flags)
2009
2155
  }
2010
2156
 
2011
2157
  /* the given fd is invalid/unusable, so make sure it doesn't hurt us anymore */
2012
- inline_speed void ecb_cold
2158
+ inline_speed ecb_cold void
2013
2159
  fd_kill (EV_P_ int fd)
2014
2160
  {
2015
2161
  ev_io *w;
@@ -2022,7 +2168,7 @@ fd_kill (EV_P_ int fd)
2022
2168
  }
2023
2169
 
2024
2170
  /* check whether the given fd is actually valid, for error recovery */
2025
- inline_size int ecb_cold
2171
+ inline_size ecb_cold int
2026
2172
  fd_valid (int fd)
2027
2173
  {
2028
2174
  #ifdef _WIN32
@@ -2033,7 +2179,8 @@ fd_valid (int fd)
2033
2179
  }
2034
2180
 
2035
2181
  /* called on EBADF to verify fds */
2036
- static void noinline ecb_cold
2182
+ noinline ecb_cold
2183
+ static void
2037
2184
  fd_ebadf (EV_P)
2038
2185
  {
2039
2186
  int fd;
@@ -2045,7 +2192,8 @@ fd_ebadf (EV_P)
2045
2192
  }
2046
2193
 
2047
2194
  /* called on ENOMEM in select/poll to kill some fds and retry */
2048
- static void noinline ecb_cold
2195
+ noinline ecb_cold
2196
+ static void
2049
2197
  fd_enomem (EV_P)
2050
2198
  {
2051
2199
  int fd;
@@ -2059,7 +2207,8 @@ fd_enomem (EV_P)
2059
2207
  }
2060
2208
 
2061
2209
  /* usually called after fork if backend needs to re-arm all fds from scratch */
2062
- static void noinline
2210
+ noinline
2211
+ static void
2063
2212
  fd_rearm_all (EV_P)
2064
2213
  {
2065
2214
  int fd;
@@ -2250,7 +2399,8 @@ static ANSIG signals [EV_NSIG - 1];
2250
2399
 
2251
2400
  #if EV_SIGNAL_ENABLE || EV_ASYNC_ENABLE
2252
2401
 
2253
- static void noinline ecb_cold
2402
+ noinline ecb_cold
2403
+ static void
2254
2404
  evpipe_init (EV_P)
2255
2405
  {
2256
2406
  if (!ev_is_active (&pipe_w))
@@ -2438,7 +2588,8 @@ ev_sighandler (int signum)
2438
2588
  ev_feed_signal (signum);
2439
2589
  }
2440
2590
 
2441
- void noinline
2591
+ noinline
2592
+ void
2442
2593
  ev_feed_signal_event (EV_P_ int signum) EV_THROW
2443
2594
  {
2444
2595
  WL w;
@@ -2565,20 +2716,20 @@ childcb (EV_P_ ev_signal *sw, int revents)
2565
2716
  # include "ev_select.c"
2566
2717
  #endif
2567
2718
 
2568
- int ecb_cold
2719
+ ecb_cold int
2569
2720
  ev_version_major (void) EV_THROW
2570
2721
  {
2571
2722
  return EV_VERSION_MAJOR;
2572
2723
  }
2573
2724
 
2574
- int ecb_cold
2725
+ ecb_cold int
2575
2726
  ev_version_minor (void) EV_THROW
2576
2727
  {
2577
2728
  return EV_VERSION_MINOR;
2578
2729
  }
2579
2730
 
2580
2731
  /* return true if we are running with elevated privileges and should ignore env variables */
2581
- int inline_size ecb_cold
2732
+ inline_size ecb_cold int
2582
2733
  enable_secure (void)
2583
2734
  {
2584
2735
  #ifdef _WIN32
@@ -2589,7 +2740,8 @@ enable_secure (void)
2589
2740
  #endif
2590
2741
  }
2591
2742
 
2592
- unsigned int ecb_cold
2743
+ ecb_cold
2744
+ unsigned int
2593
2745
  ev_supported_backends (void) EV_THROW
2594
2746
  {
2595
2747
  unsigned int flags = 0;
@@ -2603,7 +2755,8 @@ ev_supported_backends (void) EV_THROW
2603
2755
  return flags;
2604
2756
  }
2605
2757
 
2606
- unsigned int ecb_cold
2758
+ ecb_cold
2759
+ unsigned int
2607
2760
  ev_recommended_backends (void) EV_THROW
2608
2761
  {
2609
2762
  unsigned int flags = ev_supported_backends ();
@@ -2625,7 +2778,8 @@ ev_recommended_backends (void) EV_THROW
2625
2778
  return flags;
2626
2779
  }
2627
2780
 
2628
- unsigned int ecb_cold
2781
+ ecb_cold
2782
+ unsigned int
2629
2783
  ev_embeddable_backends (void) EV_THROW
2630
2784
  {
2631
2785
  int flags = EVBACKEND_EPOLL | EVBACKEND_KQUEUE | EVBACKEND_PORT;
@@ -2695,7 +2849,8 @@ ev_set_loop_release_cb (EV_P_ void (*release)(EV_P) EV_THROW, void (*acquire)(EV
2695
2849
  #endif
2696
2850
 
2697
2851
  /* initialise a loop structure, must be zero-initialised */
2698
- static void noinline ecb_cold
2852
+ noinline ecb_cold
2853
+ static void
2699
2854
  loop_init (EV_P_ unsigned int flags) EV_THROW
2700
2855
  {
2701
2856
  if (!backend)
@@ -2792,7 +2947,8 @@ loop_init (EV_P_ unsigned int flags) EV_THROW
2792
2947
  }
2793
2948
 
2794
2949
  /* free up a loop structure */
2795
- void ecb_cold
2950
+ ecb_cold
2951
+ void
2796
2952
  ev_loop_destroy (EV_P)
2797
2953
  {
2798
2954
  int i;
@@ -2923,7 +3079,7 @@ loop_fork (EV_P)
2923
3079
  #endif
2924
3080
 
2925
3081
  #if EV_SIGNAL_ENABLE || EV_ASYNC_ENABLE
2926
- if (ev_is_active (&pipe_w))
3082
+ if (ev_is_active (&pipe_w) && postfork != 2)
2927
3083
  {
2928
3084
  /* pipe_write_wanted must be false now, so modifying fd vars should be safe */
2929
3085
 
@@ -2944,7 +3100,8 @@ loop_fork (EV_P)
2944
3100
 
2945
3101
  #if EV_MULTIPLICITY
2946
3102
 
2947
- struct ev_loop * ecb_cold
3103
+ ecb_cold
3104
+ struct ev_loop *
2948
3105
  ev_loop_new (unsigned int flags) EV_THROW
2949
3106
  {
2950
3107
  EV_P = (struct ev_loop *)ev_malloc (sizeof (struct ev_loop));
@@ -2962,7 +3119,8 @@ ev_loop_new (unsigned int flags) EV_THROW
2962
3119
  #endif /* multiplicity */
2963
3120
 
2964
3121
  #if EV_VERIFY
2965
- static void noinline ecb_cold
3122
+ noinline ecb_cold
3123
+ static void
2966
3124
  verify_watcher (EV_P_ W w)
2967
3125
  {
2968
3126
  assert (("libev: watcher has invalid priority", ABSPRI (w) >= 0 && ABSPRI (w) < NUMPRI));
@@ -2971,7 +3129,8 @@ verify_watcher (EV_P_ W w)
2971
3129
  assert (("libev: pending watcher not on pending queue", pendings [ABSPRI (w)][w->pending - 1].w == w));
2972
3130
  }
2973
3131
 
2974
- static void noinline ecb_cold
3132
+ noinline ecb_cold
3133
+ static void
2975
3134
  verify_heap (EV_P_ ANHE *heap, int N)
2976
3135
  {
2977
3136
  int i;
@@ -2986,7 +3145,8 @@ verify_heap (EV_P_ ANHE *heap, int N)
2986
3145
  }
2987
3146
  }
2988
3147
 
2989
- static void noinline ecb_cold
3148
+ noinline ecb_cold
3149
+ static void
2990
3150
  array_verify (EV_P_ W *ws, int cnt)
2991
3151
  {
2992
3152
  while (cnt--)
@@ -3085,7 +3245,8 @@ ev_verify (EV_P) EV_THROW
3085
3245
  #endif
3086
3246
 
3087
3247
  #if EV_MULTIPLICITY
3088
- struct ev_loop * ecb_cold
3248
+ ecb_cold
3249
+ struct ev_loop *
3089
3250
  #else
3090
3251
  int
3091
3252
  #endif
@@ -3143,7 +3304,8 @@ ev_pending_count (EV_P) EV_THROW
3143
3304
  return count;
3144
3305
  }
3145
3306
 
3146
- void noinline
3307
+ noinline
3308
+ void
3147
3309
  ev_invoke_pending (EV_P)
3148
3310
  {
3149
3311
  pendingpri = NUMPRI;
@@ -3228,7 +3390,8 @@ timers_reify (EV_P)
3228
3390
 
3229
3391
  #if EV_PERIODIC_ENABLE
3230
3392
 
3231
- static void noinline
3393
+ noinline
3394
+ static void
3232
3395
  periodic_recalc (EV_P_ ev_periodic *w)
3233
3396
  {
3234
3397
  ev_tstamp interval = w->interval > MIN_INTERVAL ? w->interval : MIN_INTERVAL;
@@ -3296,7 +3459,8 @@ periodics_reify (EV_P)
3296
3459
 
3297
3460
  /* simply recalculate all periodics */
3298
3461
  /* TODO: maybe ensure that at least one event happens when jumping forward? */
3299
- static void noinline ecb_cold
3462
+ noinline ecb_cold
3463
+ static void
3300
3464
  periodics_reschedule (EV_P)
3301
3465
  {
3302
3466
  int i;
@@ -3319,7 +3483,8 @@ periodics_reschedule (EV_P)
3319
3483
  #endif
3320
3484
 
3321
3485
  /* adjust all timers by a given offset */
3322
- static void noinline ecb_cold
3486
+ noinline ecb_cold
3487
+ static void
3323
3488
  timers_reschedule (EV_P_ ev_tstamp adjust)
3324
3489
  {
3325
3490
  int i;
@@ -3784,7 +3949,8 @@ ev_stop (EV_P_ W w)
3784
3949
 
3785
3950
  /*****************************************************************************/
3786
3951
 
3787
- void noinline
3952
+ noinline
3953
+ void
3788
3954
  ev_io_start (EV_P_ ev_io *w) EV_THROW
3789
3955
  {
3790
3956
  int fd = w->fd;
@@ -3810,7 +3976,8 @@ ev_io_start (EV_P_ ev_io *w) EV_THROW
3810
3976
  EV_FREQUENT_CHECK;
3811
3977
  }
3812
3978
 
3813
- void noinline
3979
+ noinline
3980
+ void
3814
3981
  ev_io_stop (EV_P_ ev_io *w) EV_THROW
3815
3982
  {
3816
3983
  clear_pending (EV_A_ (W)w);
@@ -3829,7 +3996,8 @@ ev_io_stop (EV_P_ ev_io *w) EV_THROW
3829
3996
  EV_FREQUENT_CHECK;
3830
3997
  }
3831
3998
 
3832
- void noinline
3999
+ noinline
4000
+ void
3833
4001
  ev_timer_start (EV_P_ ev_timer *w) EV_THROW
3834
4002
  {
3835
4003
  if (expect_false (ev_is_active (w)))
@@ -3853,7 +4021,8 @@ ev_timer_start (EV_P_ ev_timer *w) EV_THROW
3853
4021
  /*assert (("libev: internal timer heap corruption", timers [ev_active (w)] == (WT)w));*/
3854
4022
  }
3855
4023
 
3856
- void noinline
4024
+ noinline
4025
+ void
3857
4026
  ev_timer_stop (EV_P_ ev_timer *w) EV_THROW
3858
4027
  {
3859
4028
  clear_pending (EV_A_ (W)w);
@@ -3883,7 +4052,8 @@ ev_timer_stop (EV_P_ ev_timer *w) EV_THROW
3883
4052
  EV_FREQUENT_CHECK;
3884
4053
  }
3885
4054
 
3886
- void noinline
4055
+ noinline
4056
+ void
3887
4057
  ev_timer_again (EV_P_ ev_timer *w) EV_THROW
3888
4058
  {
3889
4059
  EV_FREQUENT_CHECK;
@@ -3917,7 +4087,8 @@ ev_timer_remaining (EV_P_ ev_timer *w) EV_THROW
3917
4087
  }
3918
4088
 
3919
4089
  #if EV_PERIODIC_ENABLE
3920
- void noinline
4090
+ noinline
4091
+ void
3921
4092
  ev_periodic_start (EV_P_ ev_periodic *w) EV_THROW
3922
4093
  {
3923
4094
  if (expect_false (ev_is_active (w)))
@@ -3947,7 +4118,8 @@ ev_periodic_start (EV_P_ ev_periodic *w) EV_THROW
3947
4118
  /*assert (("libev: internal periodic heap corruption", ANHE_w (periodics [ev_active (w)]) == (WT)w));*/
3948
4119
  }
3949
4120
 
3950
- void noinline
4121
+ noinline
4122
+ void
3951
4123
  ev_periodic_stop (EV_P_ ev_periodic *w) EV_THROW
3952
4124
  {
3953
4125
  clear_pending (EV_A_ (W)w);
@@ -3975,7 +4147,8 @@ ev_periodic_stop (EV_P_ ev_periodic *w) EV_THROW
3975
4147
  EV_FREQUENT_CHECK;
3976
4148
  }
3977
4149
 
3978
- void noinline
4150
+ noinline
4151
+ void
3979
4152
  ev_periodic_again (EV_P_ ev_periodic *w) EV_THROW
3980
4153
  {
3981
4154
  /* TODO: use adjustheap and recalculation */
@@ -3990,7 +4163,8 @@ ev_periodic_again (EV_P_ ev_periodic *w) EV_THROW
3990
4163
 
3991
4164
  #if EV_SIGNAL_ENABLE
3992
4165
 
3993
- void noinline
4166
+ noinline
4167
+ void
3994
4168
  ev_signal_start (EV_P_ ev_signal *w) EV_THROW
3995
4169
  {
3996
4170
  if (expect_false (ev_is_active (w)))
@@ -4072,7 +4246,8 @@ ev_signal_start (EV_P_ ev_signal *w) EV_THROW
4072
4246
  EV_FREQUENT_CHECK;
4073
4247
  }
4074
4248
 
4075
- void noinline
4249
+ noinline
4250
+ void
4076
4251
  ev_signal_stop (EV_P_ ev_signal *w) EV_THROW
4077
4252
  {
4078
4253
  clear_pending (EV_A_ (W)w);
@@ -4158,14 +4333,15 @@ ev_child_stop (EV_P_ ev_child *w) EV_THROW
4158
4333
  #define NFS_STAT_INTERVAL 30.1074891 /* for filesystems potentially failing inotify */
4159
4334
  #define MIN_STAT_INTERVAL 0.1074891
4160
4335
 
4161
- static void noinline stat_timer_cb (EV_P_ ev_timer *w_, int revents);
4336
+ noinline static void stat_timer_cb (EV_P_ ev_timer *w_, int revents);
4162
4337
 
4163
4338
  #if EV_USE_INOTIFY
4164
4339
 
4165
4340
  /* the * 2 is to allow for alignment padding, which for some reason is >> 8 */
4166
4341
  # define EV_INOTIFY_BUFSIZE (sizeof (struct inotify_event) * 2 + NAME_MAX)
4167
4342
 
4168
- static void noinline
4343
+ noinline
4344
+ static void
4169
4345
  infy_add (EV_P_ ev_stat *w)
4170
4346
  {
4171
4347
  w->wd = inotify_add_watch (fs_fd, w->path,
@@ -4239,7 +4415,8 @@ infy_add (EV_P_ ev_stat *w)
4239
4415
  if (ev_is_active (&w->timer)) ev_unref (EV_A);
4240
4416
  }
4241
4417
 
4242
- static void noinline
4418
+ noinline
4419
+ static void
4243
4420
  infy_del (EV_P_ ev_stat *w)
4244
4421
  {
4245
4422
  int slot;
@@ -4256,7 +4433,8 @@ infy_del (EV_P_ ev_stat *w)
4256
4433
  inotify_rm_watch (fs_fd, wd);
4257
4434
  }
4258
4435
 
4259
- static void noinline
4436
+ noinline
4437
+ static void
4260
4438
  infy_wd (EV_P_ int slot, int wd, struct inotify_event *ev)
4261
4439
  {
4262
4440
  if (slot < 0)
@@ -4302,7 +4480,8 @@ infy_cb (EV_P_ ev_io *w, int revents)
4302
4480
  }
4303
4481
  }
4304
4482
 
4305
- inline_size void ecb_cold
4483
+ inline_size ecb_cold
4484
+ void
4306
4485
  ev_check_2625 (EV_P)
4307
4486
  {
4308
4487
  /* kernels < 2.6.25 are borked
@@ -4410,7 +4589,8 @@ ev_stat_stat (EV_P_ ev_stat *w) EV_THROW
4410
4589
  w->attr.st_nlink = 1;
4411
4590
  }
4412
4591
 
4413
- static void noinline
4592
+ noinline
4593
+ static void
4414
4594
  stat_timer_cb (EV_P_ ev_timer *w_, int revents)
4415
4595
  {
4416
4596
  ev_stat *w = (ev_stat *)(((char *)w_) - offsetof (ev_stat, timer));
@@ -4630,7 +4810,8 @@ ev_check_stop (EV_P_ ev_check *w) EV_THROW
4630
4810
  #endif
4631
4811
 
4632
4812
  #if EV_EMBED_ENABLE
4633
- void noinline
4813
+ noinline
4814
+ void
4634
4815
  ev_embed_sweep (EV_P_ ev_embed *w) EV_THROW
4635
4816
  {
4636
4817
  ev_run (w->other, EVRUN_NOWAIT);
@@ -4937,7 +5118,8 @@ ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, vo
4937
5118
  /*****************************************************************************/
4938
5119
 
4939
5120
  #if EV_WALK_ENABLE
4940
- void ecb_cold
5121
+ ecb_cold
5122
+ void
4941
5123
  ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)) EV_THROW
4942
5124
  {
4943
5125
  int i, j;
@@ -5053,3 +5235,4 @@ ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)) EV_THROW
5053
5235
  #if EV_MULTIPLICITY
5054
5236
  #include "ev_wrap.h"
5055
5237
  #endif
5238
+