diff options
| author | Dmitry Antipov | 2014-07-11 16:19:58 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2014-07-11 16:19:58 +0400 |
| commit | 3aa96ff51efd72767f1a4e04c546187269b008c0 (patch) | |
| tree | 64b09920082278cf2d84137dd1fe66f2179b15bf /src | |
| parent | 5f7c30e757680f66be9ef4c399fd1d7ce5b66203 (diff) | |
| download | emacs-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')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/alloc.c | 7 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index e469880a4ce..52ba04d2f5f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2014-07-11 Dmitry Antipov <dmantipov@yandex.ru> | ||
| 2 | |||
| 3 | * alloc.c (Fmemory_info) [HAVE_LINUX_SYSINFO]: Return nil if | ||
| 4 | sysinfo failed. Adjust docstring. | ||
| 5 | |||
| 1 | 2014-07-11 Eli Zaretskii <eliz@gnu.org> | 6 | 2014-07-11 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | Implement memory-info for MS-DOS. | 8 | Implement memory-info for MS-DOS. |
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 | ||
| 6876 | DEFUN ("memory-info", Fmemory_info, Smemory_info, 0, 0, 0, | 6876 | DEFUN ("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). |
| 6878 | All values are in Kbytes. If there is no swap space, last two | 6878 | All values are in Kbytes. If there is no swap space, |
| 6879 | values are zero. If the system is not supported, return nil. */) | 6879 | last two values are zero. If the system is not supported |
| 6880 | or 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 |