mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Rename os_total_mem to os_get_total_mem_kib.
Also removed an unused parameter.
This commit is contained in:
parent
77c2c69479
commit
2e393110ad
@ -2029,7 +2029,7 @@ void set_init_1(void)
|
|||||||
{
|
{
|
||||||
#ifdef HAVE_TOTAL_MEM
|
#ifdef HAVE_TOTAL_MEM
|
||||||
/* Use amount of memory available to Vim. */
|
/* Use amount of memory available to Vim. */
|
||||||
n = (os_total_mem(FALSE) >> 1);
|
n = (os_get_total_mem_kib() >> 1);
|
||||||
#else
|
#else
|
||||||
n = (0x7fffffff >> 11);
|
n = (0x7fffffff >> 11);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1,13 +1,10 @@
|
|||||||
// os.c -- OS-level calls to query hardware, etc.
|
/// Functions for accessing system memory information.
|
||||||
|
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
|
|
||||||
#include "os/os.h"
|
#include "os/os.h"
|
||||||
|
|
||||||
// Return total amount of memory available in Kbyte.
|
long_u os_get_total_mem_kib(void) {
|
||||||
// Doesn't change when memory has been allocated.
|
// Convert bytes to KiB.
|
||||||
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.
|
|
||||||
return uv_get_total_memory() >> 10;
|
return uv_get_total_memory() >> 10;
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,8 @@ int os_rmdir(const char *path);
|
|||||||
/// @return `0` for success, non-zero for failure.
|
/// @return `0` for success, non-zero for failure.
|
||||||
int os_remove(const char *path);
|
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);
|
const char *os_getenv(const char *name);
|
||||||
int os_setenv(const char *name, const char *value, int overwrite);
|
int os_setenv(const char *name, const char *value, int overwrite);
|
||||||
char *os_getenvname_at_index(size_t index);
|
char *os_getenvname_at_index(size_t index);
|
||||||
|
Loading…
Reference in New Issue
Block a user