aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Watkins <chris.watkins88@gmail.com>2014-04-09 22:03:13 -0700
committerThiago de Arruda <tpadilha84@gmail.com>2014-04-12 16:52:14 -0300
commit2e393110ad9cd058be2ef162ef9f02608dc0279e (patch)
treeeb0e8f814d5d6a0ddd5458a2626029bc9540ed26 /src
parent77c2c6947974d54c28c93e6e8509bc2d07c882fe (diff)
downloadrneovim-2e393110ad9cd058be2ef162ef9f02608dc0279e.tar.gz
rneovim-2e393110ad9cd058be2ef162ef9f02608dc0279e.tar.bz2
rneovim-2e393110ad9cd058be2ef162ef9f02608dc0279e.zip
Rename os_total_mem to os_get_total_mem_kib.
Also removed an unused parameter.
Diffstat (limited to 'src')
-rw-r--r--src/option.c2
-rw-r--r--src/os/mem.c9
-rw-r--r--src/os/os.h3
3 files changed, 6 insertions, 8 deletions
diff --git a/src/option.c b/src/option.c
index 529f676886..1eccb51e5a 100644
--- a/src/option.c
+++ b/src/option.c
@@ -2029,7 +2029,7 @@ void set_init_1(void)
{
#ifdef HAVE_TOTAL_MEM
/* Use amount of memory available to Vim. */
- n = (os_total_mem(FALSE) >> 1);
+ n = (os_get_total_mem_kib() >> 1);
#else
n = (0x7fffffff >> 11);
#endif
diff --git a/src/os/mem.c b/src/os/mem.c
index b4335fd179..4eef84bfbe 100644
--- a/src/os/mem.c
+++ b/src/os/mem.c
@@ -1,13 +1,10 @@
-// os.c -- OS-level calls to query hardware, etc.
+/// Functions for accessing system memory information.
#include <uv.h>
#include "os/os.h"
-// Return total amount of memory available in Kbyte.
-// Doesn't change when memory has been allocated.
-long_u os_total_mem(int special) {
- // We need to return memory in *Kbytes* but uv_get_total_memory() returns the
- // number of bytes of total memory.
+long_u os_get_total_mem_kib(void) {
+ // Convert bytes to KiB.
return uv_get_total_memory() >> 10;
}
diff --git a/src/os/os.h b/src/os/os.h
index 45bec739f5..e624f6ac23 100644
--- a/src/os/os.h
+++ b/src/os/os.h
@@ -78,7 +78,8 @@ int os_rmdir(const char *path);
/// @return `0` for success, non-zero for failure.
int os_remove(const char *path);
-long_u os_total_mem(int special);
+/// Get the total system physical memory in KiB.
+long_u os_get_total_mem_kib(void);
const char *os_getenv(const char *name);
int os_setenv(const char *name, const char *value, int overwrite);
char *os_getenvname_at_index(size_t index);