Skip to content

Commit

Permalink
deps: update libuv to version 1.6.0
Browse files Browse the repository at this point in the history
Fixes: nodejs/node-v0.x-archive#9310
PR-URL: #1889
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
saghul authored and bnoordhuis committed Jun 3, 2015
1 parent a804026 commit aa33db3
Show file tree
Hide file tree
Showing 53 changed files with 917 additions and 364 deletions.
3 changes: 3 additions & 0 deletions deps/uv/AUTHORS
Expand Up @@ -197,3 +197,6 @@ Daryl Haresign <github@daryl.haresign.com>
Rui Abreu Ferreira <raf-ep@gmx.com>
João Reis <reis@janeasystems.com>
farblue68 <farblue68@gmail.com>
Jason Williams <necmon@yahoo.com>
Igor Soarez <igorsoarez@gmail.com>
Miodrag Milanovic <mmicko@gmail.com>
31 changes: 31 additions & 0 deletions deps/uv/ChangeLog
@@ -1,3 +1,34 @@
2015.06.04, Version 1.6.0 (Stable), adfccad76456061dfcf79b8df8e7dbfee51791d7

Changes since version 1.5.0:

* aix: fix setsockopt for multicast options (Michael)

* unix: don't block for io if any io handle is primed (Saúl Ibarra Corretgé)

* windows: MSVC 2015 has snprintf() (Rui Abreu Ferreira)

* windows: Add VS2015 support to vcbuild.bat (Jason Williams)

* doc: fix typo in tcp.rst (Igor Soarez)

* linux: work around epoll bug in kernels < 2.6.37 (Ben Noordhuis)

* unix,win: add uv_os_homedir() (cjihrig)

* stream: fix `select()` race condition (Fedor Indutny)

* unix: prevent infinite loop in uv__run_pending (Saúl Ibarra Corretgé)

* unix: make sure UDP send callbacks are asynchronous (Saúl Ibarra Corretgé)

* test: fix `platform_output` netmask printing. (Andrew Paprocki)

* aix: add ahafs autoconf detection and README notes (Andrew Paprocki)

* core: add ability to customize memory allocator (Saúl Ibarra Corretgé)


2015.05.07, Version 1.5.0 (Stable), 4e77f74c7b95b639b3397095db1bc5bcc016c203

Changes since version 1.4.2:
Expand Down
4 changes: 3 additions & 1 deletion deps/uv/Makefile.am
Expand Up @@ -45,7 +45,7 @@ include_HEADERS += include/uv-win.h include/tree.h
AM_CPPFLAGS += -I$(top_srcdir)/src/win \
-DWIN32_LEAN_AND_MEAN \
-D_WIN32_WINNT=0x0600
LIBS += -lws2_32 -lpsapi -liphlpapi -lshell32
LIBS += -lws2_32 -lpsapi -liphlpapi -lshell32 -luserenv
libuv_la_SOURCES += src/win/async.c \
src/win/atomicops-inl.h \
src/win/core.c \
Expand Down Expand Up @@ -165,6 +165,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
test/test-getnameinfo.c \
test/test-getsockname.c \
test/test-handle-fileno.c \
test/test-homedir.c \
test/test-hrtime.c \
test/test-idle.c \
test/test-ip4-addr.c \
Expand All @@ -185,6 +186,7 @@ test_run_tests_SOURCES = test/blackhole-server.c \
test/test-ping-pong.c \
test/test-pipe-bind-error.c \
test/test-pipe-connect-error.c \
test/test-pipe-connect-prepare.c \
test/test-pipe-getsockname.c \
test/test-pipe-sendmsg.c \
test/test-pipe-server-close.c \
Expand Down
12 changes: 12 additions & 0 deletions deps/uv/README.md
Expand Up @@ -185,6 +185,18 @@ OS X using the GCC or XCode toolchain.

Solaris 121 and later using GCC toolchain.

AIX 6 and later using GCC toolchain (see notes).

### AIX Notes

AIX support for filesystem events requires the non-default IBM `bos.ahafs`
package to be installed. This package provides the AIX Event Infrastructure
that is detected by `autoconf`.
[IBM documentation](http://www.ibm.com/developerworks/aix/library/au-aix_event_infrastructure/)
describes the package in more detail.

AIX support for filesystem events is not compiled when building with `gyp`.

## Patches

See the [guidelines for contributing][].
Expand Down
1 change: 1 addition & 0 deletions deps/uv/checksparse.sh
Expand Up @@ -103,6 +103,7 @@ test/test-get-loadavg.c
test/test-get-memory.c
test/test-getaddrinfo.c
test/test-getsockname.c
test/test-homedir.c
test/test-hrtime.c
test/test-idle.c
test/test-ip6-addr.c
Expand Down
3 changes: 2 additions & 1 deletion deps/uv/configure.ac
Expand Up @@ -13,7 +13,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

AC_PREREQ(2.57)
AC_INIT([libuv], [1.5.0], [https://github.com/libuv/libuv/issues])
AC_INIT([libuv], [1.6.0], [https://github.com/libuv/libuv/issues])
AC_CONFIG_MACRO_DIR([m4])
m4_include([m4/libuv-extra-automake-flags.m4])
m4_include([m4/as_case.m4])
Expand Down Expand Up @@ -58,6 +58,7 @@ AM_CONDITIONAL([NETBSD], [AS_CASE([$host_os],[netbsd*], [true], [false])
AM_CONDITIONAL([OPENBSD], [AS_CASE([$host_os],[openbsd*], [true], [false])])
AM_CONDITIONAL([SUNOS], [AS_CASE([$host_os],[solaris*], [true], [false])])
AM_CONDITIONAL([WINNT], [AS_CASE([$host_os],[mingw*], [true], [false])])
AC_CHECK_HEADERS([sys/ahafs_evProds.h])
AC_CHECK_PROG(PKG_CONFIG, pkg-config, yes)
AM_CONDITIONAL([HAVE_PKG_CONFIG], [test "x$PKG_CONFIG" != "x"])
AS_IF([test "x$PKG_CONFIG" != "x"], [
Expand Down
57 changes: 57 additions & 0 deletions deps/uv/docs/src/misc.rst
Expand Up @@ -26,6 +26,26 @@ Data types
.. note::
On Windows this field is ULONG.

.. c:type:: void* (*uv_malloc_func)(size_t size)
Replacement function for :man:`malloc(3)`.
See :c:func:`uv_replace_allocator`.
.. c:type:: void* (*uv_realloc_func)(void* ptr, size_t size)
Replacement function for :man:`realloc(3)`.
See :c:func:`uv_replace_allocator`.
.. c:type:: void* (*uv_calloc_func)(size_t count, size_t size)
Replacement function for :man:`calloc(3)`.
See :c:func:`uv_replace_allocator`.
.. c:type:: void (*uv_free_func)(void* ptr)
Replacement function for :man:`free(3)`.
See :c:func:`uv_replace_allocator`.
.. c:type:: uv_file
Cross platform representation of a file handle.
Expand Down Expand Up @@ -126,6 +146,26 @@ API
Returns the libuv version number as a string. For non-release versions
"-pre" is appended, so the version number could be "1.2.3-pre".
.. 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)
.. versionadded:: 1.6.0
Override the use of the standard library's :man:`malloc(3)`,
:man:`calloc(3)`, :man:`realloc(3)`, :man:`free(3)`, memory allocation
functions.
This function must be called before any other libuv function is called or
after all resources have been freed and thus libuv doesn't reference
any allocated memory chunk.
On success, it returns 0, if any of the function pointers is NULL it
returns UV_EINVAL.
.. warning:: There is no protection against changing the allocator multiple
times. If the user changes it they are responsible for making
sure the allocator is changed while no memory was allocated with
the previous allocator, or that they are compatible.
.. c:function:: uv_buf_t uv_buf_init(char* base, unsigned int len)
Constructor for :c:type:`uv_buf_t`.
Expand Down Expand Up @@ -227,6 +267,23 @@ API
Changes the current working directory.
.. c:function:: int uv_os_homedir(char* buffer, size_t* size)
Gets the current user's home directory. On Windows, `uv_os_homedir()` first
checks the `USERPROFILE` environment variable using
`GetEnvironmentVariableW()`. If `USERPROFILE` is not set,
`GetUserProfileDirectoryW()` is called. On all other operating systems,
`uv_os_homedir()` first checks the `HOME` environment variable using
:man:`getenv(3)`. If `HOME` is not set, :man:`getpwuid_r(3)` is called. The
user's home directory is stored in `buffer`. When `uv_os_homedir()` is
called, `size` indicates the maximum size of `buffer`. On success or
`UV_ENOBUFS` failure, `size` is set to the string length of `buffer`.
.. warning::
`uv_os_homedir()` is not thread safe.
.. versionadded:: 1.6.0
.. uint64_t uv_get_free_memory(void)
.. c:function:: uint64_t uv_get_total_memory(void)
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/docs/src/tcp.rst
Expand Up @@ -72,7 +72,7 @@ API
not guarantee that the call to :c:func:`uv_listen` or :c:func:`uv_tcp_connect`
will succeed as well.
`flags` con contain ``UV_TCP_IPV6ONLY``, in which case dual-stack support
`flags` can contain ``UV_TCP_IPV6ONLY``, in which case dual-stack support
is disabled and only IPv6 is used.
.. c:function:: int uv_tcp_getsockname(const uv_tcp_t* handle, struct sockaddr* name, int* namelen)
Expand Down
2 changes: 1 addition & 1 deletion deps/uv/include/uv-version.h
Expand Up @@ -31,7 +31,7 @@
*/

#define UV_VERSION_MAJOR 1
#define UV_VERSION_MINOR 5
#define UV_VERSION_MINOR 6
#define UV_VERSION_PATCH 0
#define UV_VERSION_IS_RELEASE 1
#define UV_VERSION_SUFFIX ""
Expand Down
12 changes: 12 additions & 0 deletions deps/uv/include/uv.h
Expand Up @@ -244,6 +244,16 @@ typedef enum {
UV_EXTERN unsigned int uv_version(void);
UV_EXTERN const char* uv_version_string(void);

typedef void* (*uv_malloc_func)(size_t size);
typedef void* (*uv_realloc_func)(void* ptr, size_t size);
typedef void* (*uv_calloc_func)(size_t count, size_t size);
typedef void (*uv_free_func)(void* ptr);

UV_EXTERN int uv_replace_allocator(uv_malloc_func malloc_func,
uv_realloc_func realloc_func,
uv_calloc_func calloc_func,
uv_free_func free_func);

UV_EXTERN uv_loop_t* uv_default_loop(void);
UV_EXTERN int uv_loop_init(uv_loop_t* loop);
UV_EXTERN int uv_loop_close(uv_loop_t* loop);
Expand Down Expand Up @@ -1028,6 +1038,8 @@ typedef struct {

UV_EXTERN int uv_getrusage(uv_rusage_t* rusage);

UV_EXTERN int uv_os_homedir(char* buffer, size_t* size);

UV_EXTERN int uv_cpu_info(uv_cpu_info_t** cpu_infos, int* count);
UV_EXTERN void uv_free_cpu_info(uv_cpu_info_t* cpu_infos, int count);

Expand Down
6 changes: 3 additions & 3 deletions deps/uv/src/fs-poll.c
Expand Up @@ -67,7 +67,7 @@ int uv_fs_poll_start(uv_fs_poll_t* handle,

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

if (ctx == NULL)
return UV_ENOMEM;
Expand Down Expand Up @@ -96,7 +96,7 @@ int uv_fs_poll_start(uv_fs_poll_t* handle,
return 0;

error:
free(ctx);
uv__free(ctx);
return err;
}

Expand Down Expand Up @@ -219,7 +219,7 @@ static void poll_cb(uv_fs_t* req) {


static void timer_close_cb(uv_handle_t* handle) {
free(container_of(handle, struct poll_ctx, timer_handle));
uv__free(container_of(handle, struct poll_ctx, timer_handle));
}


Expand Down
4 changes: 2 additions & 2 deletions deps/uv/src/threadpool.c
Expand Up @@ -122,7 +122,7 @@ UV_DESTRUCTOR(static void cleanup(void)) {
abort();

if (threads != default_threads)
free(threads);
uv__free(threads);

uv_mutex_destroy(&mutex);
uv_cond_destroy(&cond);
Expand All @@ -149,7 +149,7 @@ static void init_once(void) {

threads = default_threads;
if (nthreads > ARRAY_SIZE(default_threads)) {
threads = malloc(nthreads * sizeof(threads[0]));
threads = uv__malloc(nthreads * sizeof(threads[0]));
if (threads == NULL) {
nthreads = ARRAY_SIZE(default_threads);
threads = default_threads;
Expand Down

0 comments on commit aa33db3

Please sign in to comment.