aboutsummaryrefslogtreecommitdiff
path: root/docs/src
diff options
context:
space:
mode:
authorKelvin Jin <kelvinjin@google.com>2019-05-01 13:54:56 -0700
committercjihrig <cjihrig@gmail.com>2019-05-15 11:35:05 -0400
commitc4e9657d59723a6273ce68bda935680e1b3596c5 (patch)
treef4f6a115293f51761374346ed02e066396701e1e /docs/src
parent6602fca820d0d3cb42acb7dd096d567a5f1db16d (diff)
downloadlibuv-c4e9657d59723a6273ce68bda935680e1b3596c5.tar.gz
libuv-c4e9657d59723a6273ce68bda935680e1b3596c5.zip
unix,win: add uv_get_constrained_memory()
Fixes: https://github.com/libuv/libuv/issues/2286 PR-URL: https://github.com/libuv/libuv/pull/2289 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'docs/src')
-rw-r--r--docs/src/misc.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/src/misc.rst b/docs/src/misc.rst
index 4ad4e40a..ef70e14b 100644
--- a/docs/src/misc.rst
+++ b/docs/src/misc.rst
@@ -461,6 +461,19 @@ API
Gets memory information (in bytes).
+.. c:function:: uint64_t uv_get_constrained_memory(void)
+
+ Gets the amount of memory available to the process (in bytes) based on
+ limits imposed by the OS. If there is no such constraint, or the constraint
+ is unknown, `0` is returned. Note that it is not unusual for this value to
+ be less than or greater than :c:func:`uv_get_total_memory`.
+
+ .. note::
+ This function currently only returns a non-zero value on Linux, based
+ on cgroups if it is present.
+
+ .. versionadded:: 1.29.0
+
.. c:function:: uint64_t uv_hrtime(void)
Returns the current high-resolution real time. This is expressed in