Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 50f9615

Browse files
saghulJulien Gilli
authored and
Julien Gilli
committed
deps: update libuv to version 1.6.1
Fixes: #9310 Reviewed-By: Julien Gilli <[email protected]> PR-URL: #25475
1 parent 69967c6 commit 50f9615

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+928
-371
lines changed

deps/uv/AUTHORS

+3
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,6 @@ Daryl Haresign <[email protected]>
197197
Rui Abreu Ferreira <[email protected]>
198198
João Reis <[email protected]>
199199
farblue68 <[email protected]>
200+
Jason Williams <[email protected]>
201+
Igor Soarez <[email protected]>
202+
Miodrag Milanovic <[email protected]>

deps/uv/ChangeLog

+38
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,41 @@
1+
2015.06.06, Version 1.6.1 (Stable), 30c8be07bb78a66fdee5141626bf53a49a17094a
2+
3+
Changes since version 1.6.0:
4+
5+
* unix: handle invalid _SC_GETPW_R_SIZE_MAX values (cjihrig)
6+
7+
8+
2015.06.04, Version 1.6.0 (Stable), adfccad76456061dfcf79b8df8e7dbfee51791d7
9+
10+
Changes since version 1.5.0:
11+
12+
* aix: fix setsockopt for multicast options (Michael)
13+
14+
* unix: don't block for io if any io handle is primed (Saúl Ibarra Corretgé)
15+
16+
* windows: MSVC 2015 has snprintf() (Rui Abreu Ferreira)
17+
18+
* windows: Add VS2015 support to vcbuild.bat (Jason Williams)
19+
20+
* doc: fix typo in tcp.rst (Igor Soarez)
21+
22+
* linux: work around epoll bug in kernels < 2.6.37 (Ben Noordhuis)
23+
24+
* unix,win: add uv_os_homedir() (cjihrig)
25+
26+
* stream: fix `select()` race condition (Fedor Indutny)
27+
28+
* unix: prevent infinite loop in uv__run_pending (Saúl Ibarra Corretgé)
29+
30+
* unix: make sure UDP send callbacks are asynchronous (Saúl Ibarra Corretgé)
31+
32+
* test: fix `platform_output` netmask printing. (Andrew Paprocki)
33+
34+
* aix: add ahafs autoconf detection and README notes (Andrew Paprocki)
35+
36+
* core: add ability to customize memory allocator (Saúl Ibarra Corretgé)
37+
38+
139
2015.05.07, Version 1.5.0 (Stable), 4e77f74c7b95b639b3397095db1bc5bcc016c203
240

341
Changes since version 1.4.2:

deps/uv/Makefile.am

+3-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ include_HEADERS += include/uv-win.h include/tree.h
4545
AM_CPPFLAGS += -I$(top_srcdir)/src/win \
4646
-DWIN32_LEAN_AND_MEAN \
4747
-D_WIN32_WINNT=0x0600
48-
LIBS += -lws2_32 -lpsapi -liphlpapi -lshell32
48+
LIBS += -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv
4949
libuv_la_SOURCES += src/win/async.c \
5050
src/win/atomicops-inl.h \
5151
src/win/core.c \
@@ -165,6 +165,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
165165
test/test-getnameinfo.c \
166166
test/test-getsockname.c \
167167
test/test-handle-fileno.c \
168+
test/test-homedir.c \
168169
test/test-hrtime.c \
169170
test/test-idle.c \
170171
test/test-ip4-addr.c \
@@ -185,6 +186,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
185186
test/test-ping-pong.c \
186187
test/test-pipe-bind-error.c \
187188
test/test-pipe-connect-error.c \
189+
test/test-pipe-connect-prepare.c \
188190
test/test-pipe-getsockname.c \
189191
test/test-pipe-sendmsg.c \
190192
test/test-pipe-server-close.c \

deps/uv/README.md

+12
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,18 @@ OS X using the GCC or XCode toolchain.
185185

186186
Solaris 121 and later using GCC toolchain.
187187

188+
AIX 6 and later using GCC toolchain (see notes).
189+
190+
### AIX Notes
191+
192+
AIX support for filesystem events requires the non-default IBM `bos.ahafs`
193+
package to be installed. This package provides the AIX Event Infrastructure
194+
that is detected by `autoconf`.
195+
[IBM documentation](http://www.ibm.com/developerworks/aix/library/au-aix_event_infrastructure/)
196+
describes the package in more detail.
197+
198+
AIX support for filesystem events is not compiled when building with `gyp`.
199+
188200
## Patches
189201

190202
See the [guidelines for contributing][].

deps/uv/checksparse.sh

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ test/test-get-loadavg.c
103103
test/test-get-memory.c
104104
test/test-getaddrinfo.c
105105
test/test-getsockname.c
106+
test/test-homedir.c
106107
test/test-hrtime.c
107108
test/test-idle.c
108109
test/test-ip6-addr.c

deps/uv/configure.ac

+2-1
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.5.0], [https://github.com/libuv/libuv/issues])
16+
AC_INIT([libuv], [1.6.1], [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])
@@ -58,6 +58,7 @@ AM_CONDITIONAL([NETBSD], [AS_CASE([$host_os],[netbsd*], [true], [false])
5858
AM_CONDITIONAL([OPENBSD], [AS_CASE([$host_os],[openbsd*], [true], [false])])
5959
AM_CONDITIONAL([SUNOS], [AS_CASE([$host_os],[solaris*], [true], [false])])
6060
AM_CONDITIONAL([WINNT], [AS_CASE([$host_os],[mingw*], [true], [false])])
61+
AC_CHECK_HEADERS([sys/ahafs_evProds.h])
6162
AC_CHECK_PROG(PKG_CONFIG, pkg-config, yes)
6263
AM_CONDITIONAL([HAVE_PKG_CONFIG], [test "x$PKG_CONFIG" != "x"])
6364
AS_IF([test "x$PKG_CONFIG" != "x"], [

deps/uv/docs/src/misc.rst

+57
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,26 @@ Data types
2626
.. note::
2727
On Windows this field is ULONG.
2828

29+
.. c:type:: void* (*uv_malloc_func)(size_t size)
30+
31+
Replacement function for :man:`malloc(3)`.
32+
See :c:func:`uv_replace_allocator`.
33+
34+
.. c:type:: void* (*uv_realloc_func)(void* ptr, size_t size)
35+
36+
Replacement function for :man:`realloc(3)`.
37+
See :c:func:`uv_replace_allocator`.
38+
39+
.. c:type:: void* (*uv_calloc_func)(size_t count, size_t size)
40+
41+
Replacement function for :man:`calloc(3)`.
42+
See :c:func:`uv_replace_allocator`.
43+
44+
.. c:type:: void (*uv_free_func)(void* ptr)
45+
46+
Replacement function for :man:`free(3)`.
47+
See :c:func:`uv_replace_allocator`.
48+
2949
.. c:type:: uv_file
3050
3151
Cross platform representation of a file handle.
@@ -126,6 +146,26 @@ API
126146
Returns the libuv version number as a string. For non-release versions
127147
"-pre" is appended, so the version number could be "1.2.3-pre".
128148
149+
.. c:function:: int uv_replace_allocator(uv_malloc_func malloc_func, uv_realloc_func realloc_func, uv_calloc_func calloc_func, uv_free_func free_func)
150+
151+
.. versionadded:: 1.6.0
152+
153+
Override the use of the standard library's :man:`malloc(3)`,
154+
:man:`calloc(3)`, :man:`realloc(3)`, :man:`free(3)`, memory allocation
155+
functions.
156+
157+
This function must be called before any other libuv function is called or
158+
after all resources have been freed and thus libuv doesn't reference
159+
any allocated memory chunk.
160+
161+
On success, it returns 0, if any of the function pointers is NULL it
162+
returns UV_EINVAL.
163+
164+
.. warning:: There is no protection against changing the allocator multiple
165+
times. If the user changes it they are responsible for making
166+
sure the allocator is changed while no memory was allocated with
167+
the previous allocator, or that they are compatible.
168+
129169
.. c:function:: uv_buf_t uv_buf_init(char* base, unsigned int len)
130170
131171
Constructor for :c:type:`uv_buf_t`.
@@ -227,6 +267,23 @@ API
227267
228268
Changes the current working directory.
229269
270+
.. c:function:: int uv_os_homedir(char* buffer, size_t* size)
271+
272+
Gets the current user's home directory. On Windows, `uv_os_homedir()` first
273+
checks the `USERPROFILE` environment variable using
274+
`GetEnvironmentVariableW()`. If `USERPROFILE` is not set,
275+
`GetUserProfileDirectoryW()` is called. On all other operating systems,
276+
`uv_os_homedir()` first checks the `HOME` environment variable using
277+
:man:`getenv(3)`. If `HOME` is not set, :man:`getpwuid_r(3)` is called. The
278+
user's home directory is stored in `buffer`. When `uv_os_homedir()` is
279+
called, `size` indicates the maximum size of `buffer`. On success or
280+
`UV_ENOBUFS` failure, `size` is set to the string length of `buffer`.
281+
282+
.. warning::
283+
`uv_os_homedir()` is not thread safe.
284+
285+
.. versionadded:: 1.6.0
286+
230287
.. uint64_t uv_get_free_memory(void)
231288
.. c:function:: uint64_t uv_get_total_memory(void)
232289

deps/uv/docs/src/tcp.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ API
7272
not guarantee that the call to :c:func:`uv_listen` or :c:func:`uv_tcp_connect`
7373
will succeed as well.
7474
75-
`flags` con contain ``UV_TCP_IPV6ONLY``, in which case dual-stack support
75+
`flags` can contain ``UV_TCP_IPV6ONLY``, in which case dual-stack support
7676
is disabled and only IPv6 is used.
7777
7878
.. c:function:: int uv_tcp_getsockname(const uv_tcp_t* handle, struct sockaddr* name, int* namelen)

deps/uv/include/uv-version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
*/
3232

3333
#define UV_VERSION_MAJOR 1
34-
#define UV_VERSION_MINOR 5
35-
#define UV_VERSION_PATCH 0
34+
#define UV_VERSION_MINOR 6
35+
#define UV_VERSION_PATCH 1
3636
#define UV_VERSION_IS_RELEASE 1
3737
#define UV_VERSION_SUFFIX ""
3838

deps/uv/include/uv.h

+12
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,16 @@ typedef enum {
244244
UV_EXTERN unsigned int uv_version(void);
245245
UV_EXTERN const char* uv_version_string(void);
246246

247+
typedef void* (*uv_malloc_func)(size_t size);
248+
typedef void* (*uv_realloc_func)(void* ptr, size_t size);
249+
typedef void* (*uv_calloc_func)(size_t count, size_t size);
250+
typedef void (*uv_free_func)(void* ptr);
251+
252+
UV_EXTERN int uv_replace_allocator(uv_malloc_func malloc_func,
253+
uv_realloc_func realloc_func,
254+
uv_calloc_func calloc_func,
255+
uv_free_func free_func);
256+
247257
UV_EXTERN uv_loop_t* uv_default_loop(void);
248258
UV_EXTERN int uv_loop_init(uv_loop_t* loop);
249259
UV_EXTERN int uv_loop_close(uv_loop_t* loop);
@@ -1028,6 +1038,8 @@ typedef struct {
10281038

10291039
UV_EXTERN int uv_getrusage(uv_rusage_t* rusage);
10301040

1041+
UV_EXTERN int uv_os_homedir(char* buffer, size_t* size);
1042+
10311043
UV_EXTERN int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count);
10321044
UV_EXTERN void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count);
10331045

deps/uv/src/fs-poll.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ int uv_fs_poll_start(uv_fs_poll_t* handle,
6767

6868
loop = handle->loop;
6969
len = strlen(path);
70-
ctx = calloc(1, sizeof(*ctx) + len);
70+
ctx = uv__calloc(1, sizeof(*ctx) + len);
7171

7272
if (ctx == NULL)
7373
return UV_ENOMEM;
@@ -96,7 +96,7 @@ int uv_fs_poll_start(uv_fs_poll_t* handle,
9696
return 0;
9797

9898
error:
99-
free(ctx);
99+
uv__free(ctx);
100100
return err;
101101
}
102102

@@ -219,7 +219,7 @@ static void poll_cb(uv_fs_t* req) {
219219

220220

221221
static void timer_close_cb(uv_handle_t* handle) {
222-
free(container_of(handle, struct poll_ctx, timer_handle));
222+
uv__free(container_of(handle, struct poll_ctx, timer_handle));
223223
}
224224

225225

deps/uv/src/threadpool.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ UV_DESTRUCTOR(static void cleanup(void)) {
122122
abort();
123123

124124
if (threads != default_threads)
125-
free(threads);
125+
uv__free(threads);
126126

127127
uv_mutex_destroy(&mutex);
128128
uv_cond_destroy(&cond);
@@ -149,7 +149,7 @@ static void init_once(void) {
149149

150150
threads = default_threads;
151151
if (nthreads > ARRAY_SIZE(default_threads)) {
152-
threads = malloc(nthreads * sizeof(threads[0]));
152+
threads = uv__malloc(nthreads * sizeof(threads[0]));
153153
if (threads == NULL) {
154154
nthreads = ARRAY_SIZE(default_threads);
155155
threads = default_threads;

0 commit comments

Comments
 (0)