aboutsummaryrefslogtreecommitdiff
path: root/src/os/mem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os/mem.c')
-rw-r--r--src/os/mem.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/os/mem.c b/src/os/mem.c
new file mode 100644
index 0000000000..20abd58261
--- /dev/null
+++ b/src/os/mem.c
@@ -0,0 +1,26 @@
+/* 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 <uv.h>
+
+#include "os.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;
+}