aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
authorDmitry Antipov2014-07-11 16:19:58 +0400
committerDmitry Antipov2014-07-11 16:19:58 +0400
commit3aa96ff51efd72767f1a4e04c546187269b008c0 (patch)
tree64b09920082278cf2d84137dd1fe66f2179b15bf /src/alloc.c
parent5f7c30e757680f66be9ef4c399fd1d7ce5b66203 (diff)
downloademacs-3aa96ff51efd72767f1a4e04c546187269b008c0.tar.gz
emacs-3aa96ff51efd72767f1a4e04c546187269b008c0.zip
* src/alloc.c (Fmemory_info) [HAVE_LINUX_SYSINFO]: Return nil if
sysinfo failed. Adjust docstring. * doc/lispref/internals.texi (Garbage Collection): Mention memory-info. * lisp/files.el (out-of-memory-warning-percentage): New defcustom. (warn-maybe-out-of-memory): Use it.
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 77be94d73d1..a8ad44491fa 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -6875,8 +6875,9 @@ gc_sweep (void)
6875 6875
6876DEFUN ("memory-info", Fmemory_info, Smemory_info, 0, 0, 0, 6876DEFUN ("memory-info", Fmemory_info, Smemory_info, 0, 0, 0,
6877 doc: /* Return a list of (TOTAL-RAM FREE-RAM TOTAL-SWAP FREE-SWAP). 6877 doc: /* Return a list of (TOTAL-RAM FREE-RAM TOTAL-SWAP FREE-SWAP).
6878All values are in Kbytes. If there is no swap space, last two 6878All values are in Kbytes. If there is no swap space,
6879values are zero. If the system is not supported, return nil. */) 6879last two values are zero. If the system is not supported
6880or memory information can't be obtained, return nil. */)
6880 (void) 6881 (void)
6881{ 6882{
6882#if defined HAVE_LINUX_SYSINFO 6883#if defined HAVE_LINUX_SYSINFO
@@ -6884,7 +6885,7 @@ values are zero. If the system is not supported, return nil. */)
6884 uintmax_t units; 6885 uintmax_t units;
6885 6886
6886 if (sysinfo (&si)) 6887 if (sysinfo (&si))
6887 emacs_abort (); 6888 return Qnil;
6888#ifdef LINUX_SYSINFO_UNIT 6889#ifdef LINUX_SYSINFO_UNIT
6889 units = si.mem_unit; 6890 units = si.mem_unit;
6890#else 6891#else