diff options
| author | Eli Zaretskii | 2014-07-11 13:09:51 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2014-07-11 13:09:51 +0300 |
| commit | 5f7c30e757680f66be9ef4c399fd1d7ce5b66203 (patch) | |
| tree | a7a1c1806020f496dc2948622a6e43b8b06df4cf /src/alloc.c | |
| parent | 8f4fc468ca50120c2218f74555301d68004d8217 (diff) | |
| download | emacs-5f7c30e757680f66be9ef4c399fd1d7ce5b66203.tar.gz emacs-5f7c30e757680f66be9ef4c399fd1d7ce5b66203.zip | |
Implement memory-info for MS-DOS.
src/dosfns.c (dos_memory_info): New function.
src/dosfns.h (dos_memory_info): Add prototype.
src/alloc.c (Fmemory_info) [MSDOS]: Call dos_memory_info.
src/vm-limit.c (get_lim_data) [MSDOS]: Call dos_memory_info, instead
of doing some of its job.
Diffstat (limited to 'src/alloc.c')
| -rw-r--r-- | src/alloc.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/alloc.c b/src/alloc.c index 4a912703c39..77be94d73d1 100644 --- a/src/alloc.c +++ b/src/alloc.c | |||
| @@ -53,6 +53,10 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 53 | #include <sys/sysinfo.h> | 53 | #include <sys/sysinfo.h> |
| 54 | #endif | 54 | #endif |
| 55 | 55 | ||
| 56 | #ifdef MSDOS | ||
| 57 | #include "dosfns.h" /* For dos_memory_info. */ | ||
| 58 | #endif | ||
| 59 | |||
| 56 | #if (defined ENABLE_CHECKING \ | 60 | #if (defined ENABLE_CHECKING \ |
| 57 | && defined HAVE_VALGRIND_VALGRIND_H \ | 61 | && defined HAVE_VALGRIND_VALGRIND_H \ |
| 58 | && !defined USE_VALGRIND) | 62 | && !defined USE_VALGRIND) |
| @@ -6900,10 +6904,21 @@ values are zero. If the system is not supported, return nil. */) | |||
| 6900 | (uintmax_t) freeswap / 1024); | 6904 | (uintmax_t) freeswap / 1024); |
| 6901 | else | 6905 | else |
| 6902 | return Qnil; | 6906 | return Qnil; |
| 6903 | #else /* not HAVE_LINUX_SYSINFO, not WINDOWSNT */ | 6907 | #elif defined MSDOS |
| 6908 | unsigned long totalram, freeram, totalswap, freeswap; | ||
| 6909 | |||
| 6910 | if (dos_memory_info (&totalram, &freeram, &totalswap, &freeswap) == 0) | ||
| 6911 | return list4i ((uintmax_t) totalram / 1024, | ||
| 6912 | (uintmax_t) freeram / 1024, | ||
| 6913 | (uintmax_t) totalswap / 1024, | ||
| 6914 | (uintmax_t) freeswap / 1024); | ||
| 6915 | else | ||
| 6916 | return Qnil; | ||
| 6917 | } | ||
| 6918 | #else /* not HAVE_LINUX_SYSINFO, not WINDOWSNT, not MSDOS */ | ||
| 6904 | /* FIXME: add more systems. */ | 6919 | /* FIXME: add more systems. */ |
| 6905 | return Qnil; | 6920 | return Qnil; |
| 6906 | #endif /* HAVE_LINUX_SYSINFO */ | 6921 | #endif /* HAVE_LINUX_SYSINFO, not WINDOWSNT, not MSDOS */ |
| 6907 | } | 6922 | } |
| 6908 | 6923 | ||
| 6909 | /* Debugging aids. */ | 6924 | /* Debugging aids. */ |