summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2014-07-11 13:09:51 +0300
committerEli Zaretskii <eliz@gnu.org>2014-07-11 13:09:51 +0300
commit5f7c30e757680f66be9ef4c399fd1d7ce5b66203 (patch)
treea7a1c1806020f496dc2948622a6e43b8b06df4cf /src/alloc.c
parent8f4fc468ca50120c2218f74555301d68004d8217 (diff)
downloademacs-5f7c30e757680f66be9ef4c399fd1d7ce5b66203.tar.gz
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.c19
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/>. */
#include <sys/sysinfo.h>
#endif
+#ifdef MSDOS
+#include "dosfns.h" /* For dos_memory_info. */
+#endif
+
#if (defined ENABLE_CHECKING \
&& defined HAVE_VALGRIND_VALGRIND_H \
&& !defined USE_VALGRIND)
@@ -6900,10 +6904,21 @@ values are zero. If the system is not supported, return nil. */)
(uintmax_t) freeswap / 1024);
else
return Qnil;
-#else /* not HAVE_LINUX_SYSINFO, not WINDOWSNT */
+#elif defined MSDOS
+ unsigned long totalram, freeram, totalswap, freeswap;
+
+ if (dos_memory_info (&totalram, &freeram, &totalswap, &freeswap) == 0)
+ return list4i ((uintmax_t) totalram / 1024,
+ (uintmax_t) freeram / 1024,
+ (uintmax_t) totalswap / 1024,
+ (uintmax_t) freeswap / 1024);
+ else
+ return Qnil;
+}
+#else /* not HAVE_LINUX_SYSINFO, not WINDOWSNT, not MSDOS */
/* FIXME: add more systems. */
return Qnil;
-#endif /* HAVE_LINUX_SYSINFO */
+#endif /* HAVE_LINUX_SYSINFO, not WINDOWSNT, not MSDOS */
}
/* Debugging aids. */