ext/libuv/docs/src/misc.rst in libuv-1.2.0 vs ext/libuv/docs/src/misc.rst in libuv-1.3.0
- old
+ new
@@ -13,10 +13,31 @@
.. c:type:: uv_buf_t
Buffer data type.
+ .. c:member:: char* uv_buf_t.base
+
+ Pointer to the base of the buffer. Readonly.
+
+ .. c:member:: size_t uv_buf_t.len
+
+ Total bytes in the buffer. Readonly.
+
+ .. note::
+ On Windows this field is ULONG.
+
+.. c:type:: uv_malloc_func
+
+ Function pointer type for the malloc override used by
+ :c:func:`uv_replace_allocator`.
+
+.. c:type:: uv_free_func
+
+ Function pointer type for the free override used by
+ :c:func:`uv_replace_allocator`.
+
.. c:type:: uv_file
Cross platform representation of a file handle.
.. c:type:: uv_os_sock_t
@@ -24,11 +45,11 @@
Cross platform representation of a socket handle.
.. c:type:: uv_os_fd_t
Abstract representation of a file descriptor. On Unix systems this is a
- `typedef` of `int` and on Windows fa `HANDLE`.
+ `typedef` of `int` and on Windows a `HANDLE`.
.. c:type:: uv_rusage_t
Data type for resource usage results.
@@ -99,11 +120,12 @@
Used to detect what type of stream should be used with a given file
descriptor. Usually this will be used during initialization to guess the
type of the stdio streams.
- For ``isatty()`` functionality use this function and test for ``UV_TTY``.
+ For :man:`isatty(3)` equivalent functionality use this function and test
+ for ``UV_TTY``.
.. c:function:: unsigned int uv_version(void)
Returns the libuv version packed into a single integer. 8 bits are used for
each component, with the patch number stored in the 8 least significant
@@ -112,10 +134,20 @@
.. c:function:: const char* uv_version_string(void)
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_free_func free_func)
+
+ .. versionadded:: 1.5.0
+
+ Override the use of the standard library's malloc and free functions for
+ memory allocation. If used, this function must be called before any
+ other libuv function is called. On success, it returns 0. If called more
+ than once, the replacement request is ignored and the function returns
+ ``UV_EINVAL``.
+
.. c:function:: uv_buf_t uv_buf_init(char* base, unsigned int len)
Constructor for :c:type:`uv_buf_t`.
Due to platform differences the user cannot rely on the ordering of the
@@ -193,11 +225,11 @@
Convert a binary structure containing an IPv6 address to a string.
.. c:function:: int uv_inet_ntop(int af, const void* src, char* dst, size_t size)
.. c:function:: int uv_inet_pton(int af, const char* src, void* dst)
- Cross-platform IPv6-capable implementation of the 'standard' ``inet_ntop()``
- and ``inet_pton()`` functions. On success they return 0. In case of error
+ Cross-platform IPv6-capable implementation of :man:`inet_ntop(3)`
+ and :man:`inet_pton(3)`. On success they return 0. In case of error
the target `dst` pointer is unmodified.
.. c:function:: int uv_exepath(char* buffer, size_t* size)
Gets the executable path.