Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gevent
Commits
35ff8ede
Commit
35ff8ede
authored
Mar 09, 2016
by
Jason Madden
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update libev to version 4.22
parent
bf62d1aa
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
194 additions
and
54 deletions
+194
-54
changelog.rst
changelog.rst
+5
-0
libev/Changes
libev/Changes
+10
-0
libev/configure
libev/configure
+1
-1
libev/ev.c
libev/ev.c
+172
-39
libev/ev.h
libev/ev.h
+1
-1
libev/ev_epoll.c
libev/ev_epoll.c
+2
-2
libev/ev_win32.c
libev/ev_win32.c
+3
-11
No files found.
changelog.rst
View file @
35ff8ede
...
@@ -4,6 +4,11 @@
...
@@ -4,6 +4,11 @@
.. currentmodule:: gevent
.. currentmodule:: gevent
1.2a1 (unreleased)
==================
- Update libev to version 4.22.
1.1.0 (Mar 5, 2016)
1.1.0 (Mar 5, 2016)
===================
===================
...
...
libev/Changes
View file @
35ff8ede
...
@@ -14,6 +14,16 @@ TODO: embed watchers need updating when fd changes
...
@@ -14,6 +14,16 @@ TODO: embed watchers need updating when fd changes
TODO: document portability requirements for atomic pointer access
TODO: document portability requirements for atomic pointer access
TODO: document requirements for function pointers and calling conventions.
TODO: document requirements for function pointers and calling conventions.
4.22 Sun Dec 20 22:11:50 CET 2015
- when epoll detects unremovable fds in the fd set, rebuild
only the epoll descriptor, not the signal pipe, to avoid
SIGPIPE in ev_async_send. This doesn't solve it on fork,
so document what needs to be done in ev_loop_fork
(analyzed by Benjamin Mahler).
- remove superfluous sys/timeb.h include on win32
(analyzed by Jason Madden).
- updated libecb.
4.20 Sat Jun 20 13:01:43 CEST 2015
4.20 Sat Jun 20 13:01:43 CEST 2015
- prefer noexcept over throw () with C++ 11.
- prefer noexcept over throw () with C++ 11.
- update ecb.h due to incompatibilities with c11.
- update ecb.h due to incompatibilities with c11.
...
...
libev/configure
View file @
35ff8ede
...
@@ -2721,7 +2721,7 @@ fi
...
@@ -2721,7 +2721,7 @@ fi
# Define the identity of the package.
# Define the identity of the package.
PACKAGE
=
libev
PACKAGE
=
libev
VERSION
=
4.2
0
VERSION
=
4.2
2
cat
>>
confdefs.h
<<
_ACEOF
cat
>>
confdefs.h
<<
_ACEOF
...
...
libev/ev.c
View file @
35ff8ede
...
@@ -534,7 +534,7 @@ struct signalfd_siginfo
...
@@ -534,7 +534,7 @@ struct signalfd_siginfo
#define ECB_H
#define ECB_H
/* 16 bits major, 16 bits minor */
/* 16 bits major, 16 bits minor */
#define ECB_VERSION 0x0001000
4
#define ECB_VERSION 0x0001000
5
#ifdef _WIN32
#ifdef _WIN32
typedef
signed
char
int8_t
;
typedef
signed
char
int8_t
;
...
@@ -561,7 +561,7 @@ struct signalfd_siginfo
...
@@ -561,7 +561,7 @@ struct signalfd_siginfo
#endif
#endif
#else
#else
#include <inttypes.h>
#include <inttypes.h>
#if
UINTMAX_MAX
> 0xffffffffU
#if
(defined INTPTR_MAX ? INTPTR_MAX : ULONG_MAX)
> 0xffffffffU
#define ECB_PTRSIZE 8
#define ECB_PTRSIZE 8
#else
#else
#define ECB_PTRSIZE 4
#define ECB_PTRSIZE 4
...
@@ -649,6 +649,10 @@ struct signalfd_siginfo
...
@@ -649,6 +649,10 @@ struct signalfd_siginfo
#include <builtins.h>
#include <builtins.h>
#endif
#endif
#if 1400 <= _MSC_VER
#include <intrin.h>
/* fence functions _ReadBarrier, also bit search functions _BitScanReverse */
#endif
#ifndef ECB_MEMORY_FENCE
#ifndef ECB_MEMORY_FENCE
#if ECB_GCC_VERSION(2,5) || defined __INTEL_COMPILER || (__llvm__ && __GNUC__) || __SUNPRO_C >= 0x5110 || __SUNPRO_CC >= 0x5110
#if ECB_GCC_VERSION(2,5) || defined __INTEL_COMPILER || (__llvm__ && __GNUC__) || __SUNPRO_C >= 0x5110 || __SUNPRO_CC >= 0x5110
#if __i386 || __i386__
#if __i386 || __i386__
...
@@ -661,15 +665,23 @@ struct signalfd_siginfo
...
@@ -661,15 +665,23 @@ struct signalfd_siginfo
#define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("")
#define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("")
#elif __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__
#elif __powerpc__ || __ppc__ || __powerpc64__ || __ppc64__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory")
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("sync" : : : "memory")
#elif defined __ARM_ARCH_2__ \
|| defined __ARM_ARCH_3__ || defined __ARM_ARCH_3M__ \
|| defined __ARM_ARCH_4__ || defined __ARM_ARCH_4T__ \
|| defined __ARM_ARCH_5__ || defined __ARM_ARCH_5E__ \
|| defined __ARM_ARCH_5T__ || defined __ARM_ARCH_5TE__ \
|| defined __ARM_ARCH_5TEJ__
/* should not need any, unless running old code on newer cpu - arm doesn't support that */
#elif defined __ARM_ARCH_6__ || defined __ARM_ARCH_6J__ \
#elif defined __ARM_ARCH_6__ || defined __ARM_ARCH_6J__ \
|| defined __ARM_ARCH_6K__ || defined __ARM_ARCH_6ZK__
|| defined __ARM_ARCH_6K__ || defined __ARM_ARCH_6ZK__ \
|| defined __ARM_ARCH_6T2__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("mcr p15,0,%0,c7,c10,5" : : "r" (0) : "memory")
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("mcr p15,0,%0,c7,c10,5" : : "r" (0) : "memory")
#elif defined __ARM_ARCH_7__ || defined __ARM_ARCH_7A__ \
#elif defined __ARM_ARCH_7__ || defined __ARM_ARCH_7A__ \
|| defined __ARM_ARCH_7
M__ || defined __ARM_ARCH_7R
__
|| defined __ARM_ARCH_7
R__ || defined __ARM_ARCH_7M
__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb" : : : "memory")
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb" : : : "memory")
#elif __aarch64__
#elif __aarch64__
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb ish" : : : "memory")
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("dmb ish" : : : "memory")
#elif (__sparc || __sparc__) && !
__sparcv8
#elif (__sparc || __sparc__) && !
(__sparc_v8__ || defined __sparcv8)
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad | #StoreStore | #StoreLoad" : : : "memory")
#define ECB_MEMORY_FENCE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad | #StoreStore | #StoreLoad" : : : "memory")
#define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad" : : : "memory")
#define ECB_MEMORY_FENCE_ACQUIRE __asm__ __volatile__ ("membar #LoadStore | #LoadLoad" : : : "memory")
#define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("membar #LoadStore | #StoreStore")
#define ECB_MEMORY_FENCE_RELEASE __asm__ __volatile__ ("membar #LoadStore | #StoreStore")
...
@@ -917,6 +929,11 @@ typedef int ecb_bool;
...
@@ -917,6 +929,11 @@ typedef int ecb_bool;
ecb_function_
ecb_const
int
ecb_function_
ecb_const
int
ecb_ctz32
(
uint32_t
x
)
ecb_ctz32
(
uint32_t
x
)
{
{
#if 1400 <= _MSC_VER && (_M_IX86 || _M_X64 || _M_IA64 || _M_ARM)
unsigned
long
r
;
_BitScanForward
(
&
r
,
x
);
return
(
int
)
r
;
#else
int
r
=
0
;
int
r
=
0
;
x
&=
~
x
+
1
;
/* this isolates the lowest bit */
x
&=
~
x
+
1
;
/* this isolates the lowest bit */
...
@@ -936,14 +953,21 @@ typedef int ecb_bool;
...
@@ -936,14 +953,21 @@ typedef int ecb_bool;
#endif
#endif
return
r
;
return
r
;
#endif
}
}
ecb_function_
ecb_const
int
ecb_ctz64
(
uint64_t
x
);
ecb_function_
ecb_const
int
ecb_ctz64
(
uint64_t
x
);
ecb_function_
ecb_const
int
ecb_function_
ecb_const
int
ecb_ctz64
(
uint64_t
x
)
ecb_ctz64
(
uint64_t
x
)
{
{
int
shift
=
x
&
0xffffffffU
?
0
:
32
;
#if 1400 <= _MSC_VER && (_M_X64 || _M_IA64 || _M_ARM)
unsigned
long
r
;
_BitScanForward64
(
&
r
,
x
);
return
(
int
)
r
;
#else
int
shift
=
x
&
0xffffffff
?
0
:
32
;
return
ecb_ctz32
(
x
>>
shift
)
+
shift
;
return
ecb_ctz32
(
x
>>
shift
)
+
shift
;
#endif
}
}
ecb_function_
ecb_const
int
ecb_popcount32
(
uint32_t
x
);
ecb_function_
ecb_const
int
ecb_popcount32
(
uint32_t
x
);
...
@@ -961,6 +985,11 @@ typedef int ecb_bool;
...
@@ -961,6 +985,11 @@ typedef int ecb_bool;
ecb_function_
ecb_const
int
ecb_ld32
(
uint32_t
x
);
ecb_function_
ecb_const
int
ecb_ld32
(
uint32_t
x
);
ecb_function_
ecb_const
int
ecb_ld32
(
uint32_t
x
)
ecb_function_
ecb_const
int
ecb_ld32
(
uint32_t
x
)
{
{
#if 1400 <= _MSC_VER && (_M_IX86 || _M_X64 || _M_IA64 || _M_ARM)
unsigned
long
r
;
_BitScanReverse
(
&
r
,
x
);
return
(
int
)
r
;
#else
int
r
=
0
;
int
r
=
0
;
if
(
x
>>
16
)
{
x
>>=
16
;
r
+=
16
;
}
if
(
x
>>
16
)
{
x
>>=
16
;
r
+=
16
;
}
...
@@ -970,16 +999,23 @@ typedef int ecb_bool;
...
@@ -970,16 +999,23 @@ typedef int ecb_bool;
if
(
x
>>
1
)
{
r
+=
1
;
}
if
(
x
>>
1
)
{
r
+=
1
;
}
return
r
;
return
r
;
#endif
}
}
ecb_function_
ecb_const
int
ecb_ld64
(
uint64_t
x
);
ecb_function_
ecb_const
int
ecb_ld64
(
uint64_t
x
);
ecb_function_
ecb_const
int
ecb_ld64
(
uint64_t
x
)
ecb_function_
ecb_const
int
ecb_ld64
(
uint64_t
x
)
{
{
#if 1400 <= _MSC_VER && (_M_X64 || _M_IA64 || _M_ARM)
unsigned
long
r
;
_BitScanReverse64
(
&
r
,
x
);
return
(
int
)
r
;
#else
int
r
=
0
;
int
r
=
0
;
if
(
x
>>
32
)
{
x
>>=
32
;
r
+=
32
;
}
if
(
x
>>
32
)
{
x
>>=
32
;
r
+=
32
;
}
return
r
+
ecb_ld32
(
x
);
return
r
+
ecb_ld32
(
x
);
#endif
}
}
#endif
#endif
...
@@ -1092,8 +1128,8 @@ ecb_inline ecb_const uint64_t ecb_rotr64 (uint64_t x, unsigned int count) { retu
...
@@ -1092,8 +1128,8 @@ ecb_inline ecb_const uint64_t ecb_rotr64 (uint64_t x, unsigned int count) { retu
/* try to tell the compiler that some condition is definitely true */
/* try to tell the compiler that some condition is definitely true */
#define ecb_assume(cond) if (!(cond)) ecb_unreachable (); else 0
#define ecb_assume(cond) if (!(cond)) ecb_unreachable (); else 0
ecb_inline
ecb_const
u
nsigned
char
ecb_byteorder_helper
(
void
);
ecb_inline
ecb_const
u
int32_t
ecb_byteorder_helper
(
void
);
ecb_inline
ecb_const
u
nsigned
char
ecb_inline
ecb_const
u
int32_t
ecb_byteorder_helper
(
void
)
ecb_byteorder_helper
(
void
)
{
{
/* the union code still generates code under pressure in gcc, */
/* the union code still generates code under pressure in gcc, */
...
@@ -1102,26 +1138,28 @@ ecb_byteorder_helper (void)
...
@@ -1102,26 +1138,28 @@ ecb_byteorder_helper (void)
/* the reason why we have this horrible preprocessor mess */
/* the reason why we have this horrible preprocessor mess */
/* is to avoid it in all cases, at least on common architectures */
/* is to avoid it in all cases, at least on common architectures */
/* or when using a recent enough gcc version (>= 4.6) */
/* or when using a recent enough gcc version (>= 4.6) */
#if ((__i386 || __i386__) && !__VOS__) || _M_IX86 || ECB_GCC_AMD64 || ECB_MSVC_AMD64
#if (defined __BYTE_ORDER__ && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) \
return
0x44
;
|| ((__i386 || __i386__ || _M_IX86 || ECB_GCC_AMD64 || ECB_MSVC_AMD64) && !__VOS__)
#elif __BYTE_ORDER__ && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define ECB_LITTLE_ENDIAN 1
return
0x44
;
return
0x44332211
;
#elif __BYTE_ORDER__ && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#elif (defined __BYTE_ORDER__ && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) \
return
0x11
;
|| ((__AARCH64EB__ || __MIPSEB__ || __ARMEB__) && !__VOS__)
#define ECB_BIG_ENDIAN 1
return
0x11223344
;
#else
#else
union
union
{
{
uint
32_t
i
;
uint
8_t
c
[
4
]
;
uint
8_t
c
;
uint
32_t
u
;
}
u
=
{
0x11
2233
44
};
}
u
=
{
0x11
,
0x22
,
0x33
,
0x
44
};
return
u
.
c
;
return
u
.
u
;
#endif
#endif
}
}
ecb_inline
ecb_const
ecb_bool
ecb_big_endian
(
void
);
ecb_inline
ecb_const
ecb_bool
ecb_big_endian
(
void
);
ecb_inline
ecb_const
ecb_bool
ecb_big_endian
(
void
)
{
return
ecb_byteorder_helper
()
==
0x11
;
}
ecb_inline
ecb_const
ecb_bool
ecb_big_endian
(
void
)
{
return
ecb_byteorder_helper
()
==
0x11
223344
;
}
ecb_inline
ecb_const
ecb_bool
ecb_little_endian
(
void
);
ecb_inline
ecb_const
ecb_bool
ecb_little_endian
(
void
);
ecb_inline
ecb_const
ecb_bool
ecb_little_endian
(
void
)
{
return
ecb_byteorder_helper
()
==
0x44
;
}
ecb_inline
ecb_const
ecb_bool
ecb_little_endian
(
void
)
{
return
ecb_byteorder_helper
()
==
0x44
332211
;
}
#if ECB_GCC_VERSION(3,0) || ECB_C99
#if ECB_GCC_VERSION(3,0) || ECB_C99
#define ecb_mod(m,n) ((m) % (n) + ((m) % (n) < 0 ? (n) : 0))
#define ecb_mod(m,n) ((m) % (n) + ((m) % (n) < 0 ? (n) : 0))
...
@@ -1156,6 +1194,102 @@ ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_he
...
@@ -1156,6 +1194,102 @@ ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_he
#define ecb_array_length(name) (sizeof (name) / sizeof (name [0]))
#define ecb_array_length(name) (sizeof (name) / sizeof (name [0]))
#endif
#endif
ecb_function_
ecb_const
uint32_t
ecb_binary16_to_binary32
(
uint32_t
x
);
ecb_function_
ecb_const
uint32_t
ecb_binary16_to_binary32
(
uint32_t
x
)
{
unsigned
int
s
=
(
x
&
0x8000
)
<<
(
31
-
15
);
int
e
=
(
x
>>
10
)
&
0x001f
;
unsigned
int
m
=
x
&
0x03ff
;
if
(
ecb_expect_false
(
e
==
31
))
/* infinity or NaN */
e
=
255
-
(
127
-
15
);
else
if
(
ecb_expect_false
(
!
e
))
{
if
(
ecb_expect_true
(
!
m
))
/* zero, handled by code below by forcing e to 0 */
e
=
0
-
(
127
-
15
);
else
{
/* subnormal, renormalise */
unsigned
int
s
=
10
-
ecb_ld32
(
m
);
m
=
(
m
<<
s
)
&
0x3ff
;
/* mask implicit bit */
e
-=
s
-
1
;
}
}
/* e and m now are normalised, or zero, (or inf or nan) */
e
+=
127
-
15
;
return
s
|
(
e
<<
23
)
|
(
m
<<
(
23
-
10
));
}
ecb_function_
ecb_const
uint16_t
ecb_binary32_to_binary16
(
uint32_t
x
);
ecb_function_
ecb_const
uint16_t
ecb_binary32_to_binary16
(
uint32_t
x
)
{
unsigned
int
s
=
(
x
>>
16
)
&
0x00008000
;
/* sign bit, the easy part */
unsigned
int
e
=
((
x
>>
23
)
&
0x000000ff
)
-
(
127
-
15
);
/* the desired exponent */
unsigned
int
m
=
x
&
0x007fffff
;
x
&=
0x7fffffff
;
/* if it's within range of binary16 normals, use fast path */
if
(
ecb_expect_true
(
0x38800000
<=
x
&&
x
<=
0x477fefff
))
{
/* mantissa round-to-even */
m
+=
0x00000fff
+
((
m
>>
(
23
-
10
))
&
1
);
/* handle overflow */
if
(
ecb_expect_false
(
m
>=
0x00800000
))
{
m
>>=
1
;
e
+=
1
;
}
return
s
|
(
e
<<
10
)
|
(
m
>>
(
23
-
10
));
}
/* handle large numbers and infinity */
if
(
ecb_expect_true
(
0x477fefff
<
x
&&
x
<=
0x7f800000
))
return
s
|
0x7c00
;
/* handle zero, subnormals and small numbers */
if
(
ecb_expect_true
(
x
<
0x38800000
))
{
/* zero */
if
(
ecb_expect_true
(
!
x
))
return
s
;
/* handle subnormals */
/* too small, will be zero */
if
(
e
<
(
14
-
24
))
/* might not be sharp, but is good enough */
return
s
;
m
|=
0x00800000
;
/* make implicit bit explicit */
/* very tricky - we need to round to the nearest e (+10) bit value */
{
unsigned
int
bits
=
14
-
e
;
unsigned
int
half
=
(
1
<<
(
bits
-
1
))
-
1
;
unsigned
int
even
=
(
m
>>
bits
)
&
1
;
/* if this overflows, we will end up with a normalised number */
m
=
(
m
+
half
+
even
)
>>
bits
;
}
return
s
|
m
;
}
/* handle NaNs, preserve leftmost nan bits, but make sure we don't turn them into infinities */
m
>>=
13
;
return
s
|
0x7c00
|
m
|
!
m
;
}
/*******************************************************************************/
/*******************************************************************************/
/* floating point stuff, can be disabled by defining ECB_NO_LIBM */
/* floating point stuff, can be disabled by defining ECB_NO_LIBM */
...
@@ -1207,23 +1341,6 @@ ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_he
...
@@ -1207,23 +1341,6 @@ ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_he
#define ecb_frexpf(x,e) (float) frexp ((double) (x), (e))
#define ecb_frexpf(x,e) (float) frexp ((double) (x), (e))
#endif
#endif
/* converts an ieee half/binary16 to a float */
ecb_function_
ecb_const
float
ecb_binary16_to_float
(
uint16_t
x
);
ecb_function_
ecb_const
float
ecb_binary16_to_float
(
uint16_t
x
)
{
int
e
=
(
x
>>
10
)
&
0x1f
;
int
m
=
x
&
0x3ff
;
float
r
;
if
(
!
e
)
r
=
ecb_ldexpf
(
m
,
-
24
);
else
if
(
e
!=
31
)
r
=
ecb_ldexpf
(
m
+
0x400
,
e
-
25
);
else
if
(
m
)
r
=
ECB_NAN
;
else
r
=
ECB_INFINITY
;
return
x
&
0x8000
?
-
r
:
r
;
}
/* convert a float to ieee single/binary32 */
/* convert a float to ieee single/binary32 */
ecb_function_
ecb_const
uint32_t
ecb_float_to_binary32
(
float
x
);
ecb_function_
ecb_const
uint32_t
ecb_float_to_binary32
(
float
x
);
ecb_function_
ecb_const
uint32_t
ecb_function_
ecb_const
uint32_t
...
@@ -1364,6 +1481,22 @@ ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_he
...
@@ -1364,6 +1481,22 @@ ecb_inline ecb_const ecb_bool ecb_little_endian (void) { return ecb_byteorder_he
return
r
;
return
r
;
}
}
/* convert a float to ieee half/binary16 */
ecb_function_
ecb_const
uint16_t
ecb_float_to_binary16
(
float
x
);
ecb_function_
ecb_const
uint16_t
ecb_float_to_binary16
(
float
x
)
{
return
ecb_binary32_to_binary16
(
ecb_float_to_binary32
(
x
));
}
/* convert an ieee half/binary16 to float */
ecb_function_
ecb_const
float
ecb_binary16_to_float
(
uint16_t
x
);
ecb_function_
ecb_const
float
ecb_binary16_to_float
(
uint16_t
x
)
{
return
ecb_binary32_to_float
(
ecb_binary16_to_binary32
(
x
));
}
#endif
#endif
#endif
#endif
...
@@ -1809,7 +1942,7 @@ array_nextsize (int elem, int cur, int cnt)
...
@@ -1809,7 +1942,7 @@ array_nextsize (int elem, int cur, int cnt)
return
ncur
;
return
ncur
;
}
}
static
void
*
ecb_cold
static
void
*
noinline
ecb_cold
array_realloc
(
int
elem
,
void
*
base
,
int
*
cur
,
int
cnt
)
array_realloc
(
int
elem
,
void
*
base
,
int
*
cur
,
int
cnt
)
{
{
*
cur
=
array_nextsize
(
elem
,
*
cur
,
cnt
);
*
cur
=
array_nextsize
(
elem
,
*
cur
,
cnt
);
...
@@ -2918,7 +3051,7 @@ loop_fork (EV_P)
...
@@ -2918,7 +3051,7 @@ loop_fork (EV_P)
#endif
#endif
#if EV_SIGNAL_ENABLE || EV_ASYNC_ENABLE
#if EV_SIGNAL_ENABLE || EV_ASYNC_ENABLE
if
(
ev_is_active
(
&
pipe_w
))
if
(
ev_is_active
(
&
pipe_w
)
&&
postfork
!=
2
)
{
{
/* pipe_write_wanted must be false now, so modifying fd vars should be safe */
/* pipe_write_wanted must be false now, so modifying fd vars should be safe */
...
...
libev/ev.h
View file @
35ff8ede
...
@@ -211,7 +211,7 @@ struct ev_loop;
...
@@ -211,7 +211,7 @@ struct ev_loop;
/*****************************************************************************/
/*****************************************************************************/
#define EV_VERSION_MAJOR 4
#define EV_VERSION_MAJOR 4
#define EV_VERSION_MINOR 2
0
#define EV_VERSION_MINOR 2
2
/* eventmask, revents, events... */
/* eventmask, revents, events... */
enum
{
enum
{
...
...
libev/ev_epoll.c
View file @
35ff8ede
...
@@ -179,7 +179,7 @@ epoll_poll (EV_P_ ev_tstamp timeout)
...
@@ -179,7 +179,7 @@ epoll_poll (EV_P_ ev_tstamp timeout)
if
(
expect_false
((
uint32_t
)
anfds
[
fd
].
egen
!=
(
uint32_t
)(
ev
->
data
.
u64
>>
32
)))
if
(
expect_false
((
uint32_t
)
anfds
[
fd
].
egen
!=
(
uint32_t
)(
ev
->
data
.
u64
>>
32
)))
{
{
/* recreate kernel state */
/* recreate kernel state */
postfork
=
1
;
postfork
|=
2
;
continue
;
continue
;
}
}
...
@@ -203,7 +203,7 @@ epoll_poll (EV_P_ ev_tstamp timeout)
...
@@ -203,7 +203,7 @@ epoll_poll (EV_P_ ev_tstamp timeout)
/* which is fortunately easy to do for us. */
/* which is fortunately easy to do for us. */
if
(
epoll_ctl
(
backend_fd
,
want
?
EPOLL_CTL_MOD
:
EPOLL_CTL_DEL
,
fd
,
ev
))
if
(
epoll_ctl
(
backend_fd
,
want
?
EPOLL_CTL_MOD
:
EPOLL_CTL_DEL
,
fd
,
ev
))
{
{
postfork
=
1
;
/* an error occurred, recreate kernel state */
postfork
|=
2
;
/* an error occurred, recreate kernel state */
continue
;
continue
;
}
}
}
}
...
...
libev/ev_win32.c
View file @
35ff8ede
...
@@ -39,17 +39,6 @@
...
@@ -39,17 +39,6 @@
#ifdef _WIN32
#ifdef _WIN32
/* timeb.h is actually xsi legacy functionality */
/* JAM: gevent: A CHANGES entry says that GetSystemTimeAsFileTime is now
* used instead of timeb. So maybe this isn't needed? It breaks the build
* on Visual Studio 2014.
* UPDATE: upstream confirms this isn't needed and has removed it from what will
* become 4.22. See http://lists.schmorp.de/pipermail/libev/2015q4/002586.html
*/
#if 0
#include <sys/timeb.h>
#endif
/* note: the comment below could not be substantiated, but what would I care */
/* note: the comment below could not be substantiated, but what would I care */
/* MSDN says this is required to handle SIGFPE */
/* MSDN says this is required to handle SIGFPE */
/* my wild guess would be that using something floating-pointy is required */
/* my wild guess would be that using something floating-pointy is required */
...
@@ -99,6 +88,8 @@ ev_pipe (int filedes [2])
...
@@ -99,6 +88,8 @@ ev_pipe (int filedes [2])
if
(
connect
(
sock
[
0
],
(
struct
sockaddr
*
)
&
addr
,
addr_size
))
if
(
connect
(
sock
[
0
],
(
struct
sockaddr
*
)
&
addr
,
addr_size
))
goto
fail
;
goto
fail
;
/* TODO: returns INVALID_SOCKET on winsock accept, not < 0. fix it */
/* when convenient, probably by just removing error checking altogether? */
if
((
sock
[
1
]
=
accept
(
listener
,
0
,
0
))
<
0
)
if
((
sock
[
1
]
=
accept
(
listener
,
0
,
0
))
<
0
)
goto
fail
;
goto
fail
;
...
@@ -168,3 +159,4 @@ ev_time (void)
...
@@ -168,3 +159,4 @@ ev_time (void)
}
}
#endif
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment