summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorDmitry Antipov <dmantipov@yandex.ru>2014-07-11 16:19:58 +0400
committerDmitry Antipov <dmantipov@yandex.ru>2014-07-11 16:19:58 +0400
commit3aa96ff51efd72767f1a4e04c546187269b008c0 (patch)
tree64b09920082278cf2d84137dd1fe66f2179b15bf /src/alloc.c
parent5f7c30e757680f66be9ef4c399fd1d7ce5b66203 (diff)
downloademacs-3aa96ff51efd72767f1a4e04c546187269b008c0.tar.gz
* 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)
DEFUN ("memory-info", Fmemory_info, Smemory_info, 0, 0, 0,
doc: /* Return a list of (TOTAL-RAM FREE-RAM TOTAL-SWAP FREE-SWAP).
-All values are in Kbytes. If there is no swap space, last two
-values are zero. If the system is not supported, return nil. */)
+All values are in Kbytes. If there is no swap space,
+last two values are zero. If the system is not supported
+or memory information can't be obtained, return nil. */)
(void)
{
#if defined HAVE_LINUX_SYSINFO
@@ -6884,7 +6885,7 @@ values are zero. If the system is not supported, return nil. */)
uintmax_t units;
if (sysinfo (&si))
- emacs_abort ();
+ return Qnil;
#ifdef LINUX_SYSINFO_UNIT
units = si.mem_unit;
#else