From 0f438e42a839d67b1c66ceb2817ae90b0a368c2a Mon Sep 17 00:00:00 2001 From: Rich Wareham Date: Mon, 24 Feb 2014 23:12:00 +0000 Subject: move libuv functions to os.c and io.c module Despite being an io library, the functions currently implemented with libuv include some non-I/O tasks like getting the total amount of memory. --- src/os.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/os.c (limited to 'src/os.c') diff --git a/src/os.c b/src/os.c new file mode 100644 index 0000000000..c61259dd55 --- /dev/null +++ b/src/os.c @@ -0,0 +1,27 @@ +/* vi:set ts=8 sts=4 sw=4: + * + * VIM - Vi IMproved by Bram Moolenaar + * + * Do ":help uganda" in Vim to read copying and usage conditions. + * Do ":help credits" in Vim to see a list of people who contributed. + * See README.txt for an overview of the Vim source code. + */ + +/* + * os.c -- OS-level calls to query hardware, etc. + */ + +#include "vim.h" + +#include "uv.h" + +/* + * Return total amount of memory available in Kbyte. + * Doesn't change when memory has been allocated. + */ +long_u mch_total_mem(int special) +{ + /* We need to return memory in *Kbytes* but uv_get_total_memory() returns the + * number of bytes of total memory. */ + return uv_get_total_memory() >> 10; +} -- cgit