Commit Graph

300 Commits

Author SHA1 Message Date
Saúl Ibarra Corretgé
1f711e4d6d Revert "memory: add uv_replace_allocator"
This reverts commit c272f1f1bc.

The concept will come back to libuv, but it needs some more work.
2015-04-29 09:37:02 +02:00
Daryl Haresign
706362083e docs: add some missing words
PR-URL: https://github.com/libuv/libuv/pull/332
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-04-28 22:36:33 +02:00
Corey Farrell
e2e218b760 doc: document uv_buf_t members
PR-URL: https://github.com/libuv/libuv/pull/307
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-04-07 17:13:01 +02:00
Saúl Ibarra Corretgé
db39a6ce71 doc: clarify what uv_*_open accepts
Fixes: https://github.com/libuv/libuv/issues/281
PR-URL: https://github.com/libuv/libuv/pull/284
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-23 10:55:38 +01:00
Ben Noordhuis
fc9e66e555 unix: reject non-tty fds in uv_tty_init()
Reject file descriptors that correspond to regular files or char/block
devices.  Such file descriptors are incompatible with epoll and trigger
a run-time assert.

Fixes: https://github.com/libuv/libuv/issues/255
PR-URL: https://github.com/libuv/libuv/pull/259
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-11 16:45:51 +01:00
Ben Noordhuis
868700952b doc: fix long lines in tty.rst
PR-URL: https://github.com/libuv/libuv/pull/259
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-11 16:45:24 +01:00
Brett Vickers
c272f1f1bc memory: add uv_replace_allocator
With uv_replace_allocator, it's possible to override the default
memory allocator's malloc and free calls with functions of the user's
choosing. This allows libuv to interoperate with projects requiring a
custom memory allocator.

Internally, all calls to malloc and free have been replaced with
uv__malloc and uv__free, respectively. The uv__malloc and uv__free
functions call malloc and free unless they have been overridden by a
previous call to uv_replace_allocator.

As part of this change, the special aligned memory allocations
performed in src/win/fs-event.c have been replaced with standard
allocations. The 4-byte alignment being requested in this file was
unnecessary, since standard allocators already guarantee at least an
8-byte alignment.

PR-URL: https://github.com/libuv/libuv/pull/231
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-03-05 20:02:16 +01:00
Saúl Ibarra Corretgé
8ef34592a9 doc: document uv_getnameinfo_t.{host|service}
Fixes: https://github.com/libuv/libuv/issues/182
PR-URL: https://github.com/libuv/libuv/pull/233
Reviewed-By: Tim Caswell <tim@creationix.com>
2015-03-02 16:53:57 +01:00
Saúl Ibarra Corretgé
3b0998c935 doc: link system and library calls to man pages
PR-URL: https://github.com/libuv/libuv/pull/236
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-02 14:20:51 +01:00
Saúl Ibarra Corretgé
5ba687f422 doc: add Sphinx plugin for generating links to man pages
PR-URL: https://github.com/libuv/libuv/pull/236
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-03-02 14:20:02 +01:00
Andrius Bentkus
901824ba77 doc: clarify that the thread pool primites are not thread safe
PR-URL: https://github.com/libuv/libuv/pull/227
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-26 11:35:01 +01:00
Saúl Ibarra Corretgé
7a3af176bd doc: adjust next version to 1.4.1 2015-02-24 20:44:02 +01:00
Ben Noordhuis
ff0316813d unix,windows: make uv_thread_create() return errno
Before this commit, UNIX returned -1 on failure.  Windows sometimes
returned a UV_E* error code and sometimes a bogus status code, courtesy
of errno values not mapping to UV_E* error codes on that platform.

PR-URL: https://github.com/libuv/libuv/pull/204
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-17 22:25:01 +01:00
Ben Noordhuis
b36d4ff930 unix: implement uv_stream_set_blocking()
Commit 393c1c5 ("unix: set non-block mode in uv_{pipe,tcp,udp}_open")
causes a regression in the io.js cluster module.

The io.js documentation states that `worker.send()` and `process.send()`
are synchronous but they no longer were after upgrading to libuv v1.2.1.

The reason they are synchronous is because of backpressure - or rather,
lack of backpressure: a slow consumer eventually causes a fast producer
to run out of memory because the backlog of pending messages in the
producer can grow unchecked.

Ergo, implement uv_stream_set_blocking() on UNIX platforms to let io.js
enable the old blocking behavior for pipes again.

Refs: https://github.com/iojs/io.js/issues/760
PR-URL: https://github.com/libuv/libuv/pull/187
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-02-09 13:28:52 +01:00
Andrius Bentkus
39a0936fec win, unix: add pipe_peername implementation
PR-URL: https://github.com/libuv/libuv/pull/166
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-01-28 21:40:32 +01:00
Andrius Bentkus
2bfa2e5e22 style: rename buf to buffer and len to size for consistency
PR-URL: https://github.com/libuv/libuv/pull/159
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-01-27 11:31:16 +01:00
Andrius Bentkus
1e59ab1d49 fs, pipe: no trailing terminator in exact sized buffers
uv_fs_poll_getpath, uv_pipe_getsockname, uv_fs_event_getpath used
to return the trailing null terminator, even though the functions
returned the size.

Fixes: https://github.com/libuv/libuv/issues/155
PR-URL: https://github.com/libuv/libuv/pull/159
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-01-27 11:31:16 +01:00
Saúl Ibarra Corretgé
f2bb8d394c unix, win: add synchronous uv_get{addr,name}info
PR-URL: https://github.com/libuv/libuv/pull/156
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Bert Belder <bertbelder@gmail.com>
2015-01-23 01:12:05 +01:00
Saúl Ibarra Corretgé
737cd1fb4f doc: clarify uv_default_loop
Indicate that it can (and should) also be closed, currently it's not
"special" in any way.

PR-URL: https://github.com/libuv/libuv/pull/147
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-21 09:12:25 +01:00
Alex Mo
ea5f1f98e0 doc: explain how the threadpool is allocated
Add an explanation about how libuv implements the threadpool and why.
This is so users know what behavior they should expect when they make
use of threads.

Related issue: https://github.com/libuv/libuv/issues/145

PR-URL: https://github.com/libuv/libuv/pull/146
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-21 01:16:04 +01:00
Saúl Ibarra Corretgé
7a19a48df8 doc: clarify which flags are supported in uv_fs_event_start
PR-URL: https://github.com/libuv/libuv/pull/135
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-17 09:16:32 +01:00
Saúl Ibarra Corretgé
b30a3e677b unix, windows: set non-block mode in uv_poll_init
libuv requires that the socket/fd is in non-blocking mode, so do it
internally so the user doesn't need to write platform specific code to
do so.

This also makes the API consistent with uv_{tcp,udp,pipe}_open, since
it's not required to pass the fd in non-blocking mode there either.

PR-URL: https://github.com/libuv/libuv/pull/136
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-16 10:41:00 +01:00
Ben Noordhuis
393c1c59a2 unix: set non-block mode in uv_{pipe,tcp,udp}_open
The contract specifies that the file descriptor should already be in
non-blocking mode before passing it to libuv.

However, node users don't really have an opportunity to do so, never
mind the fact that the call to uv_pipe_open() or uv_tcp_open() is an
implementation detail that most users won't be aware of.

Let's be nice and set the non-blocking flag explicitly.  It's a cheap
operation anyway.

Fixes: https://github.com/libuv/libuv/issues/124

PR: https://github.com/libuv/libuv/pull/134
Reviewed-by: Saúl Ibarra Corretgé <saghul@gmail.com>
2015-01-14 19:46:54 +01:00
Saúl Ibarra Corretgé
c9c00cdc0d doc: clarify how uv_async_send behaves
Closes #29

PR-URL: https://github.com/libuv/libuv/pull/122
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-07 14:01:16 +01:00
Saúl Ibarra Corretgé
85d6624768 doc: clarify the behavior of uv_tty_init
Closes #120

PR-URL: https://github.com/libuv/libuv/pull/121
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2015-01-07 13:58:55 +01:00
Saúl Ibarra Corretgé
36f90342a3 doc: updated version reference for TTY mode changes 2015-01-05 20:21:57 +01:00
Saúl Ibarra Corretgé
c71e7b753c doc: indicate the version where uv_tty_set_mode was changed
PR-URL: https://github.com/libuv/libuv/pull/89
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-27 19:04:59 +01:00
Yuri D'Elia
025602da13 tty: implement binary I/O terminal mode
Introduce a uv_tty_mode_t enum for uv_tty_set_mode(), with backward
compatible values.  Add a new mode UV_TTY_MODE_IO, which uses
cfmakeraw() internally.

PR-URL: https://github.com/libuv/libuv/pull/86
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Saúl Ibarra Corretgé <saghul@gmail.com>
2014-12-27 18:18:24 +01:00
Saúl Ibarra Corretgé
d4d1f32858 unix: change uv_cwd not to return a trailing slash
This aligns the behavior with the Windows implementation.

PR-URL: https://github.com/libuv/libuv/pull/63
Reviewed-By: Bert Belder <bertbelder@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-16 08:12:07 +01:00
Saúl Ibarra Corretgé
460907279e doc: fix sphinx warning 2014-12-11 17:29:24 +01:00
Saúl Ibarra Corretgé
3fef323e7c doc: indicate what version uv_loop_configure was added on
PR-URL: https://github.com/libuv/libuv/pull/60
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-11 17:29:14 +01:00
Ben Noordhuis
d3b1ccd6fb doc: document uv_loop_configure()
Move the comments from commit 9da5fd4 from the v0.10 branch into docs/.
2014-12-05 20:20:52 +01:00
Tim Caswell
dfdcfc0c4d doc: document how to get result of uv_fs_mkdtemp
PR-URL: https://github.com/libuv/libuv/pull/31
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-12-05 17:20:53 +01:00
Joey Geralnik
45c7ccce21 doc: fix spelling
Fix various typos and spelling mistakes in the documentation

PR-URL: https://github.com/libuv/libuv/pull/17
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-11-29 04:22:56 +01:00
Michael Ira Krufky
06b78e1ead doc: fix typo: Strcutures -> Structures
Signed-off-by: Michael Ira Krufky <m.krufky@samsung.com>
2014-11-26 08:42:08 +01:00
Ben Noordhuis
7ce1113885 doc,build,include: update project links
The project home has moved from https://github.com/joyent/libuv to
https://github.com/libuv/libuv.  Update the links inside the repo.
2014-11-25 15:39:12 +01:00
Elijah Andrews
156069130f readme: remove Rust from users
Closes #1572
2014-11-20 19:40:35 +01:00
Manos Nikolaidis
0fc24f6f74 doc: fix link in misc.rst 2014-11-18 08:24:48 +01:00
Alexis Campailla
6591d000d1 win: fix uv_thread_self()
59658a8de7 changed uv_thread_self()
to return uv_thread_t, but uv_thread_t is a thread's HANDLE while
uv_thread_self() returns the current thread's id.
This means that uv_thread_equal() is also broken, as we are
potentially comparing HANDLES to ids.

Changed uv_thread_self() to return the current thread's creation handle.
Fixed small doc issue.
2014-11-10 20:03:01 -03:00
Saúl Ibarra Corretgé
e03c0c7383 doc: fix parameter name in uv_fs_access
Closes #1560
2014-11-06 21:14:57 -05:00
Tomasz Kołodziejski
59658a8de7 unix, windows: add uv_thread_equal 2014-10-20 09:51:49 +02:00
cjihrig
c18205a1c5 unix, windows: add uv_fs_access() 2014-10-13 10:23:53 +02:00
Saúl Ibarra Corretgé
e4dc4aaac5 doc: add documentation for missing functions and structures
* uv_process_kill, uv_kill
* uv_fs_poll_init
* uv_timespec_t
2014-10-01 09:23:09 +02:00
Saúl Ibarra Corretgé
00df3ec75b doc: clarify uv_loop_t.data field lifetime
Fixes #1503
2014-09-30 09:14:56 +02:00
Saúl Ibarra Corretgé
9486e462fc doc: document missing stream related structures
uv_connect_t, uv_write_t and uv_shutdown_t.

Closes #1507
2014-09-30 09:09:59 +02:00
Saúl Ibarra Corretgé
958009bb04 doc: add migration guide from version 0.10 2014-09-26 10:05:23 +02:00
Saúl Ibarra Corretgé
5e822033b4 doc: document uv_alloc_cb
Fixes #1498
2014-09-25 21:38:03 +02:00
Saúl Ibarra Corretgé
03e53f1cf7 fs: rename uv_fs_readdir to uv_fs_scandir
Closes #1431
2014-09-25 10:09:58 +02:00
Saúl Ibarra Corretgé
f70b3fae8b version: add ability to specify a version suffix 2014-09-11 20:58:41 +02:00
Saúl Ibarra Corretgé
32e2e75f60 doc: add API documentation 2014-09-11 09:38:35 +02:00