cool.io 1.4.6-x64-mingw32 → 1.5.3-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
2
  SHA1:
3
- metadata.gz: 625a78faf12abc853a015edb265dc6a5c45b78c4
4
- data.tar.gz: e6d7d5282851b2d76e8117442d61e188a999d5ac
3
+ metadata.gz: 48291e9cbaba98e8349bed09cacdafdbf7120a98
4
+ data.tar.gz: 48162b48d6d3d11805adaf95513c6adf0c6b73d4
5
5
  SHA512:
6
- metadata.gz: ede84aeeb11af60bcc50b7f798273d9faf1558695326c1909700573f8bb67ed5a7dde2ec03ff9ec1cf50f5de083619069cccd77be4d25ea191eec446f61de9a4
7
- data.tar.gz: 4badfa759f6651616e60c513aab844231d64f1da3d000606746dd655a65eac6f38efdcd4add541e88a731a31529ed8cc9b71b9d4cee55468132892e9372ca0b8
6
+ metadata.gz: c7d4c3c7f4815f9ca2ace669e68191a814f031a1fa3ec4e49a8b9cc7831f49cedbbc01ad7788288d2b3eba2f0df5a3149593300bec20551145fad0eaadf006b6
7
+ data.tar.gz: 5f1cf7b08b3c980ec22cbf96bf0d2efaa80fc9cb8bbae629f3a32d4b3191ea82deac19eadb6a3cc941a3feefec33fd0d197ed43b2befa330e304e8c92a78aa30
@@ -8,6 +8,7 @@ rvm:
8
8
  - 2.1
9
9
  - 2.2
10
10
  - 2.3.0
11
+ - 2.4.1
11
12
  - ruby-head
12
13
  - rbx
13
14
 
data/CHANGES.md CHANGED
@@ -1,3 +1,23 @@
1
+ 1.5.3
2
+ -----
3
+
4
+ * Fix invalid IOWatcher's rb_funcall that causes ArgumentError with ruby 2.5 and clang
5
+
6
+ 1.5.2
7
+ -----
8
+
9
+ * Fix invalid TimerWatcher's rb_funcall that causes ArgumentError with ruby 2.5 and clang
10
+
11
+ 1.5.1
12
+ -----
13
+
14
+ * Don't raise an exception when peername failed
15
+
16
+ 1.5.0
17
+ -----
18
+
19
+ * Update libev to 4.24
20
+
1
21
  1.4.6
2
22
  -----
3
23
 
@@ -181,9 +181,9 @@ static void Coolio_IOWatcher_libev_callback(struct ev_loop *ev_loop, struct ev_i
181
181
  static void Coolio_IOWatcher_dispatch_callback(VALUE self, int revents)
182
182
  {
183
183
  if(revents & EV_READ)
184
- rb_funcall(self, rb_intern("on_readable"), 0, 0);
184
+ rb_funcall(self, rb_intern("on_readable"), 0);
185
185
  else if(revents & EV_WRITE)
186
- rb_funcall(self, rb_intern("on_writable"), 0, 0);
186
+ rb_funcall(self, rb_intern("on_writable"), 0);
187
187
  else
188
188
  rb_raise(rb_eRuntimeError, "unknown revents value for ev_io: %d", revents);
189
189
  }
@@ -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
  }
@@ -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
+
@@ -539,7 +539,7 @@ struct signalfd_siginfo
539
539
  #define ECB_H
540
540
 
541
541
  /* 16 bits major, 16 bits minor */
542
- #define ECB_VERSION 0x00010004
542
+ #define ECB_VERSION 0x00010005
543
543
 
544
544
  #ifdef _WIN32
545
545
  typedef signed char int8_t;
@@ -566,7 +566,7 @@ struct signalfd_siginfo
566
566
  #endif
567
567
  #else
568
568
  #include <inttypes.h>
569
- #if UINTMAX_MAX > 0xffffffffU
569
+ #if (defined INTPTR_MAX ? INTPTR_MAX : ULONG_MAX) > 0xffffffffU
570
570
  #define ECB_PTRSIZE 8
571
571
  #else
572
572
  #define ECB_PTRSIZE 4
@@ -654,6 +654,10 @@ struct signalfd_siginfo
654
654
  #include <builtins.h>
655
655
  #endif
656
656
 
657
+ #if 1400 <= _MSC_VER
658
+ #include <intrin.h> /* fence functions _ReadBarrier, also bit search functions _BitScanReverse */
659
+ #endif
660
+
657
661
  #ifndef ECB_MEMORY_FENCE
658
662
  #if ECB_GCC_VERSION(2,5) || defined __INTEL_COMPILER || (__llvm__ && __GNUC__) || __SUNPRO_C >= 0x5110 || __SUNPRO_CC >= 0x5110
659
663
  #if __i386 || __i386__
@@ -666,15 +670,23 @@ struct signalfd_siginfo
666
670
  #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("")
667
671
  #elif __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__
668
672
  #define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory")
673
+ #elif defined __ARM_ARCH_2__ \
674
+ || defined __ARM_ARCH_3__ || defined __ARM_ARCH_3M__ \
675
+ || defined __ARM_ARCH_4__ || defined __ARM_ARCH_4T__ \
676
+ || defined __ARM_ARCH_5__ || defined __ARM_ARCH_5E__ \
677
+ || defined __ARM_ARCH_5T__ || defined __ARM_ARCH_5TE__ \
678
+ || defined __ARM_ARCH_5TEJ__
679
+ /* should not need any, unless running old code on newer cpu - arm doesn't support that */
669
680
  #elif defined __ARM_ARCH_6__ || defined __ARM_ARCH_6J__ \
670
- || defined __ARM_ARCH_6K__ || defined __ARM_ARCH_6ZK__
681
+ || defined __ARM_ARCH_6K__ || defined __ARM_ARCH_6ZK__ \
682
+ || defined __ARM_ARCH_6T2__
671
683
  #define ECB_MEMORY_FENCE __asm__ __volatile__ ("mcr p15,0,%0,c7,c10,5" : : "r" (0) : "memory")
672
684
  #elif defined __ARM_ARCH_7__ || defined __ARM_ARCH_7A__ \
673
- || defined __ARM_ARCH_7M__ || defined __ARM_ARCH_7R__
685
+ || defined __ARM_ARCH_7R__ || defined __ARM_ARCH_7M__
674
686
  #define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb" : : : "memory")
675
687
  #elif __aarch64__
676
688
  #define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb ish" : : : "memory")
677
- #elif (__sparc || __sparc__) && !__sparcv8
689
+ #elif (__sparc || __sparc__) && !(__sparc_v8__ || defined __sparcv8)
678
690
  #define ECB_MEMORY_FENCE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad | #StoreStore | #StoreLoad" : : : "memory")
679
691
  #define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad" : : : "memory")
680
692
  #define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("membar #LoadStore | #StoreStore")
@@ -922,6 +934,11 @@ typedef int ecb_bool;
922
934
  ecb_function_ ecb_const int
923
935
  ecb_ctz32 (uint32_t x)
924
936
  {
937
+ #if 1400 <= _MSC_VER && (_M_IX86 || _M_X64 || _M_IA64 || _M_ARM)
938
+ unsigned long r;
939
+ _BitScanForward (&r, x);
940
+ return (int)r;
941
+ #else
925
942
  int r = 0;
926
943
 
927
944
  x &= ~x + 1; /* this isolates the lowest bit */
@@ -941,14 +958,21 @@ typedef int ecb_bool;
941
958
  #endif
942
959
 
943
960
  return r;
961
+ #endif
944
962
  }
945
963
 
946
964
  ecb_function_ ecb_const int ecb_ctz64 (uint64_t x);
947
965
  ecb_function_ ecb_const int
948
966
  ecb_ctz64 (uint64_t x)
949
967
  {
950
- int shift = x & 0xffffffffU ? 0 : 32;
968
+ #if 1400 <= _MSC_VER && (_M_X64 || _M_IA64 || _M_ARM)
969
+ unsigned long r;
970
+ _BitScanForward64 (&r, x);
971
+ return (int)r;
972
+ #else
973
+ int shift = x & 0xffffffff ? 0 : 32;
951
974
  return ecb_ctz32 (x >> shift) + shift;
975
+ #endif
952
976
  }
953
977
 
954
978
  ecb_function_ ecb_const int ecb_popcount32 (uint32_t x);
@@ -966,6 +990,11 @@ typedef int ecb_bool;
966
990
  ecb_function_ ecb_const int ecb_ld32 (uint32_t x);
967
991
  ecb_function_ ecb_const int ecb_ld32 (uint32_t x)
968
992
  {
993
+ #if 1400 <= _MSC_VER && (_M_IX86 || _M_X64 || _M_IA64 || _M_ARM)
994
+ unsigned long r;
995
+ _BitScanReverse (&r, x);
996
+ return (int)r;
997
+ #else
969
998
  int r = 0;
970
999
 
971
1000
  if (x >> 16) { x >>= 16; r += 16; }
@@ -975,16 +1004,23 @@ typedef int ecb_bool;
975
1004
  if (x >> 1) { r += 1; }
976
1005
 
977
1006
  return r;
1007
+ #endif
978
1008
  }
979
1009
 
980
1010
  ecb_function_ ecb_const int ecb_ld64 (uint64_t x);
981
1011
  ecb_function_ ecb_const int ecb_ld64 (uint64_t x)
982
1012
  {
1013
+ #if 1400 <= _MSC_VER && (_M_X64 || _M_IA64 || _M_ARM)
1014
+ unsigned long r;
1015
+ _BitScanReverse64 (&r, x);
1016
+ return (int)r;
1017
+ #else
983
1018
  int r = 0;
984
1019
 
985
1020
  if (x >> 32) { x >>= 32; r += 32; }
986
1021
 
987
1022
  return r + ecb_ld32 (x);
1023
+ #endif
988
1024
  }
989
1025
  #endif
990
1026
 
@@ -1097,8 +1133,8 @@ ecb_inline ecb_const uint64_t ecb_rotr64 (uint64_t x, unsigned int count) { retu
1097
1133
  /* try to tell the compiler that some condition is definitely true */
1098
1134
  #define ecb_assume(cond) if (!(cond)) ecb_unreachable (); else 0
1099
1135
 
1100
- ecb_inline ecb_const unsigned char ecb_byteorder_helper (void);
1101
- ecb_inline ecb_const unsigned char
1136
+ ecb_inline ecb_const uint32_t ecb_byteorder_helper (void);
1137
+ ecb_inline ecb_const uint32_t
1102
1138
  ecb_byteorder_helper (void)
1103
1139
  {
1104
1140
  /* the union code still generates code under pressure in gcc, */
@@ -1107,26 +1143,28 @@ ecb_byteorder_helper (void)
1107
1143
  /* the reason why we have this horrible preprocessor mess */
1108
1144
  /* is to avoid it in all cases, at least on common architectures */
1109
1145
  /* 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;
1146
+ #if (defined __BYTE_ORDER__ && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) \
1147
+ || ((__i386 || __i386__ || _M_IX86 || ECB_GCC_AMD64 || ECB_MSVC_AMD64) && !__VOS__)
1148
+ #define ECB_LITTLE_ENDIAN 1
1149
+ return 0x44332211;
1150
+ #elif (defined __BYTE_ORDER__ && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) \
1151
+ || ((__AARCH64EB__ || __MIPSEB__ || __ARMEB__) && !__VOS__)
1152
+ #define ECB_BIG_ENDIAN 1
1153
+ return 0x11223344;
1116
1154
  #else
1117
1155
  union
1118
1156
  {
1119
- uint32_t i;
1120
- uint8_t c;
1121
- } u = { 0x11223344 };
1122
- return u.c;
1157
+ uint8_t c[4];
1158
+ uint32_t u;
1159
+ } u = { 0x11, 0x22, 0x33, 0x44 };
1160
+ return u.u;
1123
1161
  #endif
1124
1162
  }
1125
1163
 
1126
1164
  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; }
1165
+ ecb_inline ecb_const ecb_bool ecb_big_endian (void) { return ecb_byteorder_helper () == 0x11223344; }
1128
1166
  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; }
1167
+ ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_helper () == 0x44332211; }
1130
1168
 
1131
1169
  #if ECB_GCC_VERSION(3,0) || ECB_C99
1132
1170
  #define ecb_mod(m,n) ((m) % (n) + ((m) % (n) < 0 ? (n) : 0))
@@ -1161,6 +1199,102 @@ ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_he
1161
1199
  #define ecb_array_length(name) (sizeof (name) / sizeof (name [0]))
1162
1200
  #endif
1163
1201
 
1202
+ ecb_function_ ecb_const uint32_t ecb_binary16_to_binary32 (uint32_t x);
1203
+ ecb_function_ ecb_const uint32_t
1204
+ ecb_binary16_to_binary32 (uint32_t x)
1205
+ {
1206
+ unsigned int s = (x & 0x8000) << (31 - 15);
1207
+ int e = (x >> 10) & 0x001f;
1208
+ unsigned int m = x & 0x03ff;
1209
+
1210
+ if (ecb_expect_false (e == 31))
1211
+ /* infinity or NaN */
1212
+ e = 255 - (127 - 15);
1213
+ else if (ecb_expect_false (!e))
1214
+ {
1215
+ if (ecb_expect_true (!m))
1216
+ /* zero, handled by code below by forcing e to 0 */
1217
+ e = 0 - (127 - 15);
1218
+ else
1219
+ {
1220
+ /* subnormal, renormalise */
1221
+ unsigned int s = 10 - ecb_ld32 (m);
1222
+
1223
+ m = (m << s) & 0x3ff; /* mask implicit bit */
1224
+ e -= s - 1;
1225
+ }
1226
+ }
1227
+
1228
+ /* e and m now are normalised, or zero, (or inf or nan) */
1229
+ e += 127 - 15;
1230
+
1231
+ return s | (e << 23) | (m << (23 - 10));
1232
+ }
1233
+
1234
+ ecb_function_ ecb_const uint16_t ecb_binary32_to_binary16 (uint32_t x);
1235
+ ecb_function_ ecb_const uint16_t
1236
+ ecb_binary32_to_binary16 (uint32_t x)
1237
+ {
1238
+ unsigned int s = (x >> 16) & 0x00008000; /* sign bit, the easy part */
1239
+ unsigned int e = ((x >> 23) & 0x000000ff) - (127 - 15); /* the desired exponent */
1240
+ unsigned int m = x & 0x007fffff;
1241
+
1242
+ x &= 0x7fffffff;
1243
+
1244
+ /* if it's within range of binary16 normals, use fast path */
1245
+ if (ecb_expect_true (0x38800000 <= x && x <= 0x477fefff))
1246
+ {
1247
+ /* mantissa round-to-even */
1248
+ m += 0x00000fff + ((m >> (23 - 10)) & 1);
1249
+
1250
+ /* handle overflow */
1251
+ if (ecb_expect_false (m >= 0x00800000))
1252
+ {
1253
+ m >>= 1;
1254
+ e += 1;
1255
+ }
1256
+
1257
+ return s | (e << 10) | (m >> (23 - 10));
1258
+ }
1259
+
1260
+ /* handle large numbers and infinity */
1261
+ if (ecb_expect_true (0x477fefff < x && x <= 0x7f800000))
1262
+ return s | 0x7c00;
1263
+
1264
+ /* handle zero, subnormals and small numbers */
1265
+ if (ecb_expect_true (x < 0x38800000))
1266
+ {
1267
+ /* zero */
1268
+ if (ecb_expect_true (!x))
1269
+ return s;
1270
+
1271
+ /* handle subnormals */
1272
+
1273
+ /* too small, will be zero */
1274
+ if (e < (14 - 24)) /* might not be sharp, but is good enough */
1275
+ return s;
1276
+
1277
+ m |= 0x00800000; /* make implicit bit explicit */
1278
+
1279
+ /* very tricky - we need to round to the nearest e (+10) bit value */
1280
+ {
1281
+ unsigned int bits = 14 - e;
1282
+ unsigned int half = (1 << (bits - 1)) - 1;
1283
+ unsigned int even = (m >> bits) & 1;
1284
+
1285
+ /* if this overflows, we will end up with a normalised number */
1286
+ m = (m + half + even) >> bits;
1287
+ }
1288
+
1289
+ return s | m;
1290
+ }
1291
+
1292
+ /* handle NaNs, preserve leftmost nan bits, but make sure we don't turn them into infinities */
1293
+ m >>= 13;
1294
+
1295
+ return s | 0x7c00 | m | !m;
1296
+ }
1297
+
1164
1298
  /*******************************************************************************/
1165
1299
  /* floating point stuff, can be disabled by defining ECB_NO_LIBM */
1166
1300
 
@@ -1212,23 +1346,6 @@ ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_he
1212
1346
  #define ecb_frexpf(x,e) (float) frexp ((double) (x), (e))
1213
1347
  #endif
1214
1348
 
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
1349
  /* convert a float to ieee single/binary32 */
1233
1350
  ecb_function_ ecb_const uint32_t ecb_float_to_binary32 (float x);
1234
1351
  ecb_function_ ecb_const uint32_t
@@ -1369,6 +1486,22 @@ ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_he
1369
1486
  return r;
1370
1487
  }
1371
1488
 
1489
+ /* convert a float to ieee half/binary16 */
1490
+ ecb_function_ ecb_const uint16_t ecb_float_to_binary16 (float x);
1491
+ ecb_function_ ecb_const uint16_t
1492
+ ecb_float_to_binary16 (float x)
1493
+ {
1494
+ return ecb_binary32_to_binary16 (ecb_float_to_binary32 (x));
1495
+ }
1496
+
1497
+ /* convert an ieee half/binary16 to float */
1498
+ ecb_function_ ecb_const float ecb_binary16_to_float (uint16_t x);
1499
+ ecb_function_ ecb_const float
1500
+ ecb_binary16_to_float (uint16_t x)
1501
+ {
1502
+ return ecb_binary32_to_float (ecb_binary16_to_binary32 (x));
1503
+ }
1504
+
1372
1505
  #endif
1373
1506
 
1374
1507
  #endif
@@ -1401,7 +1534,7 @@ ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_he
1401
1534
  #if EV_FEATURE_CODE
1402
1535
  # define inline_speed ecb_inline
1403
1536
  #else
1404
- # define inline_speed static noinline
1537
+ # define inline_speed noinline static
1405
1538
  #endif
1406
1539
 
1407
1540
  #define NUMPRI (EV_MAXPRI - EV_MINPRI + 1)
@@ -1458,7 +1591,8 @@ static EV_ATOMIC_T have_monotonic; /* did clock_gettime (CLOCK_MONOTONIC) work?
1458
1591
  #include <float.h>
1459
1592
 
1460
1593
  /* a floor() replacement function, should be independent of ev_tstamp type */
1461
- static ev_tstamp noinline
1594
+ noinline
1595
+ static ev_tstamp
1462
1596
  ev_floor (ev_tstamp v)
1463
1597
  {
1464
1598
  /* the choice of shift factor is not terribly important */
@@ -1500,7 +1634,8 @@ ev_floor (ev_tstamp v)
1500
1634
  # include <sys/utsname.h>
1501
1635
  #endif
1502
1636
 
1503
- static unsigned int noinline ecb_cold
1637
+ noinline ecb_cold
1638
+ static unsigned int
1504
1639
  ev_linux_version (void)
1505
1640
  {
1506
1641
  #ifdef __linux
@@ -1539,7 +1674,8 @@ ev_linux_version (void)
1539
1674
  /*****************************************************************************/
1540
1675
 
1541
1676
  #if EV_AVOID_STDIO
1542
- static void noinline ecb_cold
1677
+ noinline ecb_cold
1678
+ static void
1543
1679
  ev_printerr (const char *msg)
1544
1680
  {
1545
1681
  write (STDERR_FILENO, msg, strlen (msg));
@@ -1548,13 +1684,15 @@ ev_printerr (const char *msg)
1548
1684
 
1549
1685
  static void (*syserr_cb)(const char *msg) EV_THROW;
1550
1686
 
1551
- void ecb_cold
1687
+ ecb_cold
1688
+ void
1552
1689
  ev_set_syserr_cb (void (*cb)(const char *msg) EV_THROW) EV_THROW
1553
1690
  {
1554
1691
  syserr_cb = cb;
1555
1692
  }
1556
1693
 
1557
- static void noinline ecb_cold
1694
+ noinline ecb_cold
1695
+ static void
1558
1696
  ev_syserr (const char *msg)
1559
1697
  {
1560
1698
  if (!msg)
@@ -1595,7 +1733,8 @@ ev_realloc_emul (void *ptr, long size) EV_THROW
1595
1733
 
1596
1734
  static void *(*alloc)(void *ptr, long size) EV_THROW = ev_realloc_emul;
1597
1735
 
1598
- void ecb_cold
1736
+ ecb_cold
1737
+ void
1599
1738
  ev_set_allocator (void *(*cb)(void *ptr, long size) EV_THROW) EV_THROW
1600
1739
  {
1601
1740
  alloc = cb;
@@ -1814,7 +1953,8 @@ array_nextsize (int elem, int cur, int cnt)
1814
1953
  return ncur;
1815
1954
  }
1816
1955
 
1817
- static void * noinline ecb_cold
1956
+ noinline ecb_cold
1957
+ static void *
1818
1958
  array_realloc (int elem, void *base, int *cur, int cnt)
1819
1959
  {
1820
1960
  *cur = array_nextsize (elem, *cur, cnt);
@@ -1827,7 +1967,7 @@ array_realloc (int elem, void *base, int *cur, int cnt)
1827
1967
  #define array_needsize(type,base,cur,cnt,init) \
1828
1968
  if (expect_false ((cnt) > (cur))) \
1829
1969
  { \
1830
- int ecb_unused ocur_ = (cur); \
1970
+ ecb_unused int ocur_ = (cur); \
1831
1971
  (base) = (type *)array_realloc \
1832
1972
  (sizeof (type), (base), &(cur), (cnt)); \
1833
1973
  init ((base) + (ocur_), (cur) - ocur_); \
@@ -1849,12 +1989,14 @@ array_realloc (int elem, void *base, int *cur, int cnt)
1849
1989
  /*****************************************************************************/
1850
1990
 
1851
1991
  /* dummy callback for pending events */
1852
- static void noinline
1992
+ noinline
1993
+ static void
1853
1994
  pendingcb (EV_P_ ev_prepare *w, int revents)
1854
1995
  {
1855
1996
  }
1856
1997
 
1857
- void noinline
1998
+ noinline
1999
+ void
1858
2000
  ev_feed_event (EV_P_ void *w, int revents) EV_THROW
1859
2001
  {
1860
2002
  W w_ = (W)w;
@@ -1994,7 +2136,8 @@ fd_reify (EV_P)
1994
2136
  }
1995
2137
 
1996
2138
  /* something about the given fd changed */
1997
- inline_size void
2139
+ inline_size
2140
+ void
1998
2141
  fd_change (EV_P_ int fd, int flags)
1999
2142
  {
2000
2143
  unsigned char reify = anfds [fd].reify;
@@ -2009,7 +2152,7 @@ fd_change (EV_P_ int fd, int flags)
2009
2152
  }
2010
2153
 
2011
2154
  /* the given fd is invalid/unusable, so make sure it doesn't hurt us anymore */
2012
- inline_speed void ecb_cold
2155
+ inline_speed ecb_cold void
2013
2156
  fd_kill (EV_P_ int fd)
2014
2157
  {
2015
2158
  ev_io *w;
@@ -2022,7 +2165,7 @@ fd_kill (EV_P_ int fd)
2022
2165
  }
2023
2166
 
2024
2167
  /* check whether the given fd is actually valid, for error recovery */
2025
- inline_size int ecb_cold
2168
+ inline_size ecb_cold int
2026
2169
  fd_valid (int fd)
2027
2170
  {
2028
2171
  #ifdef _WIN32
@@ -2033,7 +2176,8 @@ fd_valid (int fd)
2033
2176
  }
2034
2177
 
2035
2178
  /* called on EBADF to verify fds */
2036
- static void noinline ecb_cold
2179
+ noinline ecb_cold
2180
+ static void
2037
2181
  fd_ebadf (EV_P)
2038
2182
  {
2039
2183
  int fd;
@@ -2045,7 +2189,8 @@ fd_ebadf (EV_P)
2045
2189
  }
2046
2190
 
2047
2191
  /* called on ENOMEM in select/poll to kill some fds and retry */
2048
- static void noinline ecb_cold
2192
+ noinline ecb_cold
2193
+ static void
2049
2194
  fd_enomem (EV_P)
2050
2195
  {
2051
2196
  int fd;
@@ -2059,7 +2204,8 @@ fd_enomem (EV_P)
2059
2204
  }
2060
2205
 
2061
2206
  /* usually called after fork if backend needs to re-arm all fds from scratch */
2062
- static void noinline
2207
+ noinline
2208
+ static void
2063
2209
  fd_rearm_all (EV_P)
2064
2210
  {
2065
2211
  int fd;
@@ -2250,7 +2396,8 @@ static ANSIG signals [EV_NSIG - 1];
2250
2396
 
2251
2397
  #if EV_SIGNAL_ENABLE || EV_ASYNC_ENABLE
2252
2398
 
2253
- static void noinline ecb_cold
2399
+ noinline ecb_cold
2400
+ static void
2254
2401
  evpipe_init (EV_P)
2255
2402
  {
2256
2403
  if (!ev_is_active (&pipe_w))
@@ -2438,7 +2585,8 @@ ev_sighandler (int signum)
2438
2585
  ev_feed_signal (signum);
2439
2586
  }
2440
2587
 
2441
- void noinline
2588
+ noinline
2589
+ void
2442
2590
  ev_feed_signal_event (EV_P_ int signum) EV_THROW
2443
2591
  {
2444
2592
  WL w;
@@ -2565,20 +2713,20 @@ childcb (EV_P_ ev_signal *sw, int revents)
2565
2713
  # include "ev_select.c"
2566
2714
  #endif
2567
2715
 
2568
- int ecb_cold
2716
+ ecb_cold int
2569
2717
  ev_version_major (void) EV_THROW
2570
2718
  {
2571
2719
  return EV_VERSION_MAJOR;
2572
2720
  }
2573
2721
 
2574
- int ecb_cold
2722
+ ecb_cold int
2575
2723
  ev_version_minor (void) EV_THROW
2576
2724
  {
2577
2725
  return EV_VERSION_MINOR;
2578
2726
  }
2579
2727
 
2580
2728
  /* return true if we are running with elevated privileges and should ignore env variables */
2581
- int inline_size ecb_cold
2729
+ inline_size ecb_cold int
2582
2730
  enable_secure (void)
2583
2731
  {
2584
2732
  #ifdef _WIN32
@@ -2589,7 +2737,8 @@ enable_secure (void)
2589
2737
  #endif
2590
2738
  }
2591
2739
 
2592
- unsigned int ecb_cold
2740
+ ecb_cold
2741
+ unsigned int
2593
2742
  ev_supported_backends (void) EV_THROW
2594
2743
  {
2595
2744
  unsigned int flags = 0;
@@ -2603,7 +2752,8 @@ ev_supported_backends (void) EV_THROW
2603
2752
  return flags;
2604
2753
  }
2605
2754
 
2606
- unsigned int ecb_cold
2755
+ ecb_cold
2756
+ unsigned int
2607
2757
  ev_recommended_backends (void) EV_THROW
2608
2758
  {
2609
2759
  unsigned int flags = ev_supported_backends ();
@@ -2625,7 +2775,8 @@ ev_recommended_backends (void) EV_THROW
2625
2775
  return flags;
2626
2776
  }
2627
2777
 
2628
- unsigned int ecb_cold
2778
+ ecb_cold
2779
+ unsigned int
2629
2780
  ev_embeddable_backends (void) EV_THROW
2630
2781
  {
2631
2782
  int flags = EVBACKEND_EPOLL | EVBACKEND_KQUEUE | EVBACKEND_PORT;
@@ -2695,7 +2846,8 @@ ev_set_loop_release_cb (EV_P_ void (*release)(EV_P) EV_THROW, void (*acquire)(EV
2695
2846
  #endif
2696
2847
 
2697
2848
  /* initialise a loop structure, must be zero-initialised */
2698
- static void noinline ecb_cold
2849
+ noinline ecb_cold
2850
+ static void
2699
2851
  loop_init (EV_P_ unsigned int flags) EV_THROW
2700
2852
  {
2701
2853
  if (!backend)
@@ -2792,7 +2944,8 @@ loop_init (EV_P_ unsigned int flags) EV_THROW
2792
2944
  }
2793
2945
 
2794
2946
  /* free up a loop structure */
2795
- void ecb_cold
2947
+ ecb_cold
2948
+ void
2796
2949
  ev_loop_destroy (EV_P)
2797
2950
  {
2798
2951
  int i;
@@ -2923,7 +3076,7 @@ loop_fork (EV_P)
2923
3076
  #endif
2924
3077
 
2925
3078
  #if EV_SIGNAL_ENABLE || EV_ASYNC_ENABLE
2926
- if (ev_is_active (&pipe_w))
3079
+ if (ev_is_active (&pipe_w) && postfork != 2)
2927
3080
  {
2928
3081
  /* pipe_write_wanted must be false now, so modifying fd vars should be safe */
2929
3082
 
@@ -2944,7 +3097,8 @@ loop_fork (EV_P)
2944
3097
 
2945
3098
  #if EV_MULTIPLICITY
2946
3099
 
2947
- struct ev_loop * ecb_cold
3100
+ ecb_cold
3101
+ struct ev_loop *
2948
3102
  ev_loop_new (unsigned int flags) EV_THROW
2949
3103
  {
2950
3104
  EV_P = (struct ev_loop *)ev_malloc (sizeof (struct ev_loop));
@@ -2962,7 +3116,8 @@ ev_loop_new (unsigned int flags) EV_THROW
2962
3116
  #endif /* multiplicity */
2963
3117
 
2964
3118
  #if EV_VERIFY
2965
- static void noinline ecb_cold
3119
+ noinline ecb_cold
3120
+ static void
2966
3121
  verify_watcher (EV_P_ W w)
2967
3122
  {
2968
3123
  assert (("libev: watcher has invalid priority", ABSPRI (w) >= 0 && ABSPRI (w) < NUMPRI));
@@ -2971,7 +3126,8 @@ verify_watcher (EV_P_ W w)
2971
3126
  assert (("libev: pending watcher not on pending queue", pendings [ABSPRI (w)][w->pending - 1].w == w));
2972
3127
  }
2973
3128
 
2974
- static void noinline ecb_cold
3129
+ noinline ecb_cold
3130
+ static void
2975
3131
  verify_heap (EV_P_ ANHE *heap, int N)
2976
3132
  {
2977
3133
  int i;
@@ -2986,7 +3142,8 @@ verify_heap (EV_P_ ANHE *heap, int N)
2986
3142
  }
2987
3143
  }
2988
3144
 
2989
- static void noinline ecb_cold
3145
+ noinline ecb_cold
3146
+ static void
2990
3147
  array_verify (EV_P_ W *ws, int cnt)
2991
3148
  {
2992
3149
  while (cnt--)
@@ -3085,7 +3242,8 @@ ev_verify (EV_P) EV_THROW
3085
3242
  #endif
3086
3243
 
3087
3244
  #if EV_MULTIPLICITY
3088
- struct ev_loop * ecb_cold
3245
+ ecb_cold
3246
+ struct ev_loop *
3089
3247
  #else
3090
3248
  int
3091
3249
  #endif
@@ -3143,7 +3301,8 @@ ev_pending_count (EV_P) EV_THROW
3143
3301
  return count;
3144
3302
  }
3145
3303
 
3146
- void noinline
3304
+ noinline
3305
+ void
3147
3306
  ev_invoke_pending (EV_P)
3148
3307
  {
3149
3308
  pendingpri = NUMPRI;
@@ -3228,7 +3387,8 @@ timers_reify (EV_P)
3228
3387
 
3229
3388
  #if EV_PERIODIC_ENABLE
3230
3389
 
3231
- static void noinline
3390
+ noinline
3391
+ static void
3232
3392
  periodic_recalc (EV_P_ ev_periodic *w)
3233
3393
  {
3234
3394
  ev_tstamp interval = w->interval > MIN_INTERVAL ? w->interval : MIN_INTERVAL;
@@ -3296,7 +3456,8 @@ periodics_reify (EV_P)
3296
3456
 
3297
3457
  /* simply recalculate all periodics */
3298
3458
  /* TODO: maybe ensure that at least one event happens when jumping forward? */
3299
- static void noinline ecb_cold
3459
+ noinline ecb_cold
3460
+ static void
3300
3461
  periodics_reschedule (EV_P)
3301
3462
  {
3302
3463
  int i;
@@ -3319,7 +3480,8 @@ periodics_reschedule (EV_P)
3319
3480
  #endif
3320
3481
 
3321
3482
  /* adjust all timers by a given offset */
3322
- static void noinline ecb_cold
3483
+ noinline ecb_cold
3484
+ static void
3323
3485
  timers_reschedule (EV_P_ ev_tstamp adjust)
3324
3486
  {
3325
3487
  int i;
@@ -3784,7 +3946,8 @@ ev_stop (EV_P_ W w)
3784
3946
 
3785
3947
  /*****************************************************************************/
3786
3948
 
3787
- void noinline
3949
+ noinline
3950
+ void
3788
3951
  ev_io_start (EV_P_ ev_io *w) EV_THROW
3789
3952
  {
3790
3953
  int fd = w->fd;
@@ -3810,7 +3973,8 @@ ev_io_start (EV_P_ ev_io *w) EV_THROW
3810
3973
  EV_FREQUENT_CHECK;
3811
3974
  }
3812
3975
 
3813
- void noinline
3976
+ noinline
3977
+ void
3814
3978
  ev_io_stop (EV_P_ ev_io *w) EV_THROW
3815
3979
  {
3816
3980
  clear_pending (EV_A_ (W)w);
@@ -3829,7 +3993,8 @@ ev_io_stop (EV_P_ ev_io *w) EV_THROW
3829
3993
  EV_FREQUENT_CHECK;
3830
3994
  }
3831
3995
 
3832
- void noinline
3996
+ noinline
3997
+ void
3833
3998
  ev_timer_start (EV_P_ ev_timer *w) EV_THROW
3834
3999
  {
3835
4000
  if (expect_false (ev_is_active (w)))
@@ -3853,7 +4018,8 @@ ev_timer_start (EV_P_ ev_timer *w) EV_THROW
3853
4018
  /*assert (("libev: internal timer heap corruption", timers [ev_active (w)] == (WT)w));*/
3854
4019
  }
3855
4020
 
3856
- void noinline
4021
+ noinline
4022
+ void
3857
4023
  ev_timer_stop (EV_P_ ev_timer *w) EV_THROW
3858
4024
  {
3859
4025
  clear_pending (EV_A_ (W)w);
@@ -3883,7 +4049,8 @@ ev_timer_stop (EV_P_ ev_timer *w) EV_THROW
3883
4049
  EV_FREQUENT_CHECK;
3884
4050
  }
3885
4051
 
3886
- void noinline
4052
+ noinline
4053
+ void
3887
4054
  ev_timer_again (EV_P_ ev_timer *w) EV_THROW
3888
4055
  {
3889
4056
  EV_FREQUENT_CHECK;
@@ -3917,7 +4084,8 @@ ev_timer_remaining (EV_P_ ev_timer *w) EV_THROW
3917
4084
  }
3918
4085
 
3919
4086
  #if EV_PERIODIC_ENABLE
3920
- void noinline
4087
+ noinline
4088
+ void
3921
4089
  ev_periodic_start (EV_P_ ev_periodic *w) EV_THROW
3922
4090
  {
3923
4091
  if (expect_false (ev_is_active (w)))
@@ -3947,7 +4115,8 @@ ev_periodic_start (EV_P_ ev_periodic *w) EV_THROW
3947
4115
  /*assert (("libev: internal periodic heap corruption", ANHE_w (periodics [ev_active (w)]) == (WT)w));*/
3948
4116
  }
3949
4117
 
3950
- void noinline
4118
+ noinline
4119
+ void
3951
4120
  ev_periodic_stop (EV_P_ ev_periodic *w) EV_THROW
3952
4121
  {
3953
4122
  clear_pending (EV_A_ (W)w);
@@ -3975,7 +4144,8 @@ ev_periodic_stop (EV_P_ ev_periodic *w) EV_THROW
3975
4144
  EV_FREQUENT_CHECK;
3976
4145
  }
3977
4146
 
3978
- void noinline
4147
+ noinline
4148
+ void
3979
4149
  ev_periodic_again (EV_P_ ev_periodic *w) EV_THROW
3980
4150
  {
3981
4151
  /* TODO: use adjustheap and recalculation */
@@ -3990,7 +4160,8 @@ ev_periodic_again (EV_P_ ev_periodic *w) EV_THROW
3990
4160
 
3991
4161
  #if EV_SIGNAL_ENABLE
3992
4162
 
3993
- void noinline
4163
+ noinline
4164
+ void
3994
4165
  ev_signal_start (EV_P_ ev_signal *w) EV_THROW
3995
4166
  {
3996
4167
  if (expect_false (ev_is_active (w)))
@@ -4072,7 +4243,8 @@ ev_signal_start (EV_P_ ev_signal *w) EV_THROW
4072
4243
  EV_FREQUENT_CHECK;
4073
4244
  }
4074
4245
 
4075
- void noinline
4246
+ noinline
4247
+ void
4076
4248
  ev_signal_stop (EV_P_ ev_signal *w) EV_THROW
4077
4249
  {
4078
4250
  clear_pending (EV_A_ (W)w);
@@ -4158,14 +4330,15 @@ ev_child_stop (EV_P_ ev_child *w) EV_THROW
4158
4330
  #define NFS_STAT_INTERVAL 30.1074891 /* for filesystems potentially failing inotify */
4159
4331
  #define MIN_STAT_INTERVAL 0.1074891
4160
4332
 
4161
- static void noinline stat_timer_cb (EV_P_ ev_timer *w_, int revents);
4333
+ noinline static void stat_timer_cb (EV_P_ ev_timer *w_, int revents);
4162
4334
 
4163
4335
  #if EV_USE_INOTIFY
4164
4336
 
4165
4337
  /* the * 2 is to allow for alignment padding, which for some reason is >> 8 */
4166
4338
  # define EV_INOTIFY_BUFSIZE (sizeof (struct inotify_event) * 2 + NAME_MAX)
4167
4339
 
4168
- static void noinline
4340
+ noinline
4341
+ static void
4169
4342
  infy_add (EV_P_ ev_stat *w)
4170
4343
  {
4171
4344
  w->wd = inotify_add_watch (fs_fd, w->path,
@@ -4239,7 +4412,8 @@ infy_add (EV_P_ ev_stat *w)
4239
4412
  if (ev_is_active (&w->timer)) ev_unref (EV_A);
4240
4413
  }
4241
4414
 
4242
- static void noinline
4415
+ noinline
4416
+ static void
4243
4417
  infy_del (EV_P_ ev_stat *w)
4244
4418
  {
4245
4419
  int slot;
@@ -4256,7 +4430,8 @@ infy_del (EV_P_ ev_stat *w)
4256
4430
  inotify_rm_watch (fs_fd, wd);
4257
4431
  }
4258
4432
 
4259
- static void noinline
4433
+ noinline
4434
+ static void
4260
4435
  infy_wd (EV_P_ int slot, int wd, struct inotify_event *ev)
4261
4436
  {
4262
4437
  if (slot < 0)
@@ -4302,7 +4477,8 @@ infy_cb (EV_P_ ev_io *w, int revents)
4302
4477
  }
4303
4478
  }
4304
4479
 
4305
- inline_size void ecb_cold
4480
+ inline_size ecb_cold
4481
+ void
4306
4482
  ev_check_2625 (EV_P)
4307
4483
  {
4308
4484
  /* kernels < 2.6.25 are borked
@@ -4410,7 +4586,8 @@ ev_stat_stat (EV_P_ ev_stat *w) EV_THROW
4410
4586
  w->attr.st_nlink = 1;
4411
4587
  }
4412
4588
 
4413
- static void noinline
4589
+ noinline
4590
+ static void
4414
4591
  stat_timer_cb (EV_P_ ev_timer *w_, int revents)
4415
4592
  {
4416
4593
  ev_stat *w = (ev_stat *)(((char *)w_) - offsetof (ev_stat, timer));
@@ -4630,7 +4807,8 @@ ev_check_stop (EV_P_ ev_check *w) EV_THROW
4630
4807
  #endif
4631
4808
 
4632
4809
  #if EV_EMBED_ENABLE
4633
- void noinline
4810
+ noinline
4811
+ void
4634
4812
  ev_embed_sweep (EV_P_ ev_embed *w) EV_THROW
4635
4813
  {
4636
4814
  ev_run (w->other, EVRUN_NOWAIT);
@@ -4937,7 +5115,8 @@ ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, vo
4937
5115
  /*****************************************************************************/
4938
5116
 
4939
5117
  #if EV_WALK_ENABLE
4940
- void ecb_cold
5118
+ ecb_cold
5119
+ void
4941
5120
  ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)) EV_THROW
4942
5121
  {
4943
5122
  int i, j;
@@ -5053,3 +5232,4 @@ ev_walk (EV_P_ int types, void (*cb)(EV_P_ int type, void *w)) EV_THROW
5053
5232
  #if EV_MULTIPLICITY
5054
5233
  #include "ev_wrap.h"
5055
5234
  #endif
5235
+