emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/vm-limit.c


From: Richard M. Stallman
Subject: [Emacs-diffs] Changes to emacs/src/vm-limit.c
Date: Mon, 20 Feb 2006 00:00:18 +0000

Index: emacs/src/vm-limit.c
diff -u emacs/src/vm-limit.c:1.16 emacs/src/vm-limit.c:1.17
--- emacs/src/vm-limit.c:1.16   Mon Feb  6 15:23:21 2006
+++ emacs/src/vm-limit.c        Mon Feb 20 00:00:18 2006
@@ -33,6 +33,10 @@
 
 #include "mem-limits.h"
 
+#ifdef HAVE_GETRLIMIT
+#include <sys/resource.h>
+#endif
+
 /*
   Level number of warnings already issued.
   0 -- no warnings issued.
@@ -61,6 +65,19 @@
   unsigned long five_percent;
   unsigned long data_size;
 
+#ifdef HAVE_GETRLIMIT
+  struct rlimit {
+    rlim_t rlim_cur;
+    rlim_t rlim_max;
+  } rlimit;
+
+  getrlimit (RLIMIT_DATA, &rlimit);
+
+  five_percent = rlimit.rlim_max / 20;
+  data_size = rlimit.rlim_cur;
+
+#else /* not HAVE_GETRLIMIT */
+
   if (lim_data == 0)
     get_lim_data ();
   five_percent = lim_data / 20;
@@ -74,6 +91,8 @@
   cp = (char *) (*__morecore) (0);
   data_size = (char *) cp - (char *) data_space_start;
 
+#endif /* not HAVE_GETRLIMIT */
+
   if (warn_function)
     switch (warnlevel)
       {




reply via email to

[Prev in Thread] Current Thread [Next in Thread]