Skip to content

Commit 4c59407

Browse files
saghulrvagg
authored andcommitted
deps: upgrade libuv to 1.7.5
PR-URL: #3010 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Trevor Norris <trev.norris@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent d6ac547 commit 4c59407

File tree

15 files changed

+209
-291
lines changed

15 files changed

+209
-291
lines changed

deps/uv/AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,4 @@ Jianghua Yang <jianghua.yjh@alibaba-inc.com>
224224
Colin Snover <github.com@zetafleet.com>
225225
Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
226226
Eli Skeggs <skeggse@gmail.com>
227+
nmushell <nmushell@bloomberg.net>

deps/uv/ChangeLog

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
2015.09.23, Version 1.7.5 (Stable), a8c1136de2cabf25b143021488cbaab05834daa8
2+
3+
Changes since version 1.7.4:
4+
5+
* unix: Support atomic compare & swap xlC on AIX (nmushell)
6+
7+
* unix: Fix including uv-aix.h on AIX (nmushell)
8+
9+
* unix: consolidate rwlock tryrdlock trywrlock errors (Saúl Ibarra Corretgé)
10+
11+
* unix, win: consolidate mutex trylock errors (Saúl Ibarra Corretgé)
12+
13+
* darwin: fix memory leak in uv_cpu_info (Jianghua Yang)
14+
15+
* test: add tests for the uv_rwlock implementation (Bert Belder)
16+
17+
* win: redo/fix the uv_rwlock APIs (Bert Belder)
18+
19+
* win: don't fetch function pointers to SRWLock APIs (Bert Belder)
20+
21+
122
2015.09.12, Version 1.7.4 (Stable), a7ad4f52189d89cfcba35f78bfc5ff3b1f4105c4
223

324
Changes since version 1.7.3:

deps/uv/Makefile.am

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ endif
280280

281281
if AIX
282282
libuv_la_CFLAGS += -D_ALL_SOURCE -D_XOPEN_SOURCE=500 -D_LINUX_SOURCE_COMPAT
283+
include_HEADERS += include/uv-aix.h
283284
libuv_la_SOURCES += src/unix/aix.c
284285
endif
285286

deps/uv/appveyor.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: v1.7.4.build{build}
1+
version: v1.7.5.build{build}
22

33
install:
44
- cinst -y nsis

deps/uv/configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
1414

1515
AC_PREREQ(2.57)
16-
AC_INIT([libuv], [1.7.4], [https://github.com/libuv/libuv/issues])
16+
AC_INIT([libuv], [1.7.5], [https://github.com/libuv/libuv/issues])
1717
AC_CONFIG_MACRO_DIR([m4])
1818
m4_include([m4/libuv-extra-automake-flags.m4])
1919
m4_include([m4/as_case.m4])

deps/uv/include/uv-version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232

3333
#define UV_VERSION_MAJOR 1
3434
#define UV_VERSION_MINOR 7
35-
#define UV_VERSION_PATCH 4
35+
#define UV_VERSION_PATCH 5
3636
#define UV_VERSION_IS_RELEASE 1
3737
#define UV_VERSION_SUFFIX ""
3838

deps/uv/include/uv-win.h

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -246,22 +246,20 @@ typedef union {
246246
} uv_cond_t;
247247

248248
typedef union {
249-
/* srwlock_ has type SRWLOCK, but not all toolchains define this type in */
250-
/* windows.h. */
251-
SRWLOCK srwlock_;
252249
struct {
253-
union {
254-
CRITICAL_SECTION cs;
255-
/* TODO: remove me in v2.x. */
256-
uv_mutex_t unused;
257-
} read_lock_;
258-
union {
259-
HANDLE sem;
260-
/* TODO: remove me in v2.x. */
261-
uv_mutex_t unused;
262-
} write_lock_;
263250
unsigned int num_readers_;
264-
} fallback_;
251+
CRITICAL_SECTION num_readers_lock_;
252+
HANDLE write_semaphore_;
253+
} state_;
254+
/* TODO: remove me in v2.x. */
255+
struct {
256+
SRWLOCK unused_;
257+
} unused1_;
258+
/* TODO: remove me in v2.x. */
259+
struct {
260+
uv_mutex_t unused1_;
261+
uv_mutex_t unused2_;
262+
} unused2_;
265263
} uv_rwlock_t;
266264

267265
typedef struct {

deps/uv/src/unix/atomic-ops.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ UV_UNUSED(static int cmpxchgi(int* ptr, int oldval, int newval)) {
3333
: "r" (newval), "0" (oldval)
3434
: "memory");
3535
return out;
36+
#elif defined(_AIX) && defined(__xlC__)
37+
const int out = (*(volatile int*) ptr);
38+
__compare_and_swap(ptr, &oldval, newval);
39+
return out;
3640
#else
3741
return __sync_val_compare_and_swap(ptr, oldval, newval);
3842
#endif
@@ -46,6 +50,14 @@ UV_UNUSED(static long cmpxchgl(long* ptr, long oldval, long newval)) {
4650
: "r" (newval), "0" (oldval)
4751
: "memory");
4852
return out;
53+
#elif defined(_AIX) && defined(__xlC__)
54+
const long out = (*(volatile int*) ptr);
55+
# if defined(__64BIT__)
56+
__compare_and_swaplp(ptr, &oldval, newval);
57+
# else
58+
__compare_and_swap(ptr, &oldval, newval);
59+
# endif /* if defined(__64BIT__) */
60+
return out;
4961
#else
5062
return __sync_val_compare_and_swap(ptr, oldval, newval);
5163
#endif

deps/uv/src/unix/darwin.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,10 @@ int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count) {
199199
}
200200

201201
*cpu_infos = uv__malloc(numcpus * sizeof(**cpu_infos));
202-
if (!(*cpu_infos))
203-
return -ENOMEM; /* FIXME(bnoordhuis) Deallocate info? */
202+
if (!(*cpu_infos)) {
203+
vm_deallocate(mach_task_self(), (vm_address_t)info, msg_type);
204+
return -ENOMEM;
205+
}
204206

205207
*count = numcpus;
206208

deps/uv/src/unix/thread.c

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,14 +124,14 @@ void uv_mutex_lock(uv_mutex_t* mutex) {
124124
int uv_mutex_trylock(uv_mutex_t* mutex) {
125125
int err;
126126

127-
/* FIXME(bnoordhuis) EAGAIN means recursive lock limit reached. Arguably
128-
* a bug, should probably abort rather than return -EAGAIN.
129-
*/
130127
err = pthread_mutex_trylock(mutex);
131-
if (err && err != EBUSY && err != EAGAIN)
132-
abort();
128+
if (err) {
129+
if (err != EBUSY && err != EAGAIN)
130+
abort();
131+
return -EBUSY;
132+
}
133133

134-
return -err;
134+
return 0;
135135
}
136136

137137

@@ -162,10 +162,13 @@ int uv_rwlock_tryrdlock(uv_rwlock_t* rwlock) {
162162
int err;
163163

164164
err = pthread_rwlock_tryrdlock(rwlock);
165-
if (err && err != EBUSY && err != EAGAIN)
166-
abort();
165+
if (err) {
166+
if (err != EBUSY && err != EAGAIN)
167+
abort();
168+
return -EBUSY;
169+
}
167170

168-
return -err;
171+
return 0;
169172
}
170173

171174

@@ -185,10 +188,13 @@ int uv_rwlock_trywrlock(uv_rwlock_t* rwlock) {
185188
int err;
186189

187190
err = pthread_rwlock_trywrlock(rwlock);
188-
if (err && err != EBUSY && err != EAGAIN)
189-
abort();
191+
if (err) {
192+
if (err != EBUSY && err != EAGAIN)
193+
abort();
194+
return -EBUSY;
195+
}
190196

191-
return -err;
197+
return 0;
192198
}
193199

194200

0 commit comments

Comments
 (0)