From 1dc61d523d624f890f6b660198b6531ea2acd178 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Thu, 16 May 2019 14:22:40 +0200 Subject: [PATCH] now working with libuv v1.29.x (close #151) --- CMakeLists.txt | 2 +- cmake/in/deps.in | 2 +- src/uvw/util.hpp | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 332b04cc..7f8b7912 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ endif() # Project configuration # -project(uvw VERSION 1.16.0) +project(uvw VERSION 1.17.0) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug) diff --git a/cmake/in/deps.in b/cmake/in/deps.in index 4cbe4c33..0f6a1a71 100644 --- a/cmake/in/deps.in +++ b/cmake/in/deps.in @@ -17,7 +17,7 @@ ExternalProject_Add( ExternalProject_Add( libuv GIT_REPOSITORY https://github.com/libuv/libuv.git - GIT_TAG v1.28.0 + GIT_TAG v1.29.0 SOURCE_DIR @LIBUV_DEPS_DIR@ CONFIGURE_COMMAND "" BUILD_COMMAND "" diff --git a/src/uvw/util.hpp b/src/uvw/util.hpp index f0edd34a..e4135f41 100644 --- a/src/uvw/util.hpp +++ b/src/uvw/util.hpp @@ -897,6 +897,21 @@ struct Utilities { return uv_get_total_memory(); } + /** + * @brief Gets the amount of memory available to the process (in bytes). + * + * Gets the amount of memory available to the process 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 `totalMemory`. + * + * @return Amount of memory available to the process. + */ + static uint64_t constrainedMemory() noexcept { + return uv_get_constrained_memory(); + } + /** * @brief Gets the current system uptime. * @return The current system uptime or 0 in case of errors.