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,v [EMACS_22_BASE]


From: Chong Yidong
Subject: [Emacs-diffs] Changes to emacs/src/vm-limit.c,v [EMACS_22_BASE]
Date: Sun, 03 Aug 2008 14:07:10 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Branch:         EMACS_22_BASE
Changes by:     Chong Yidong <cyd>      08/08/03 14:07:10

Index: vm-limit.c
===================================================================
RCS file: /sources/emacs/emacs/src/vm-limit.c,v
retrieving revision 1.20.2.3
retrieving revision 1.20.2.4
diff -u -b -r1.20.2.3 -r1.20.2.4
--- vm-limit.c  2 Aug 2008 22:37:00 -0000       1.20.2.3
+++ vm-limit.c  3 Aug 2008 14:07:10 -0000       1.20.2.4
@@ -67,6 +67,21 @@
 }
 #else /* not NO_LIM_DATA */
 
+#if defined (HAVE_GETRLIMIT) && defined (RLIMIT_AS)
+static void
+get_lim_data ()
+{
+  struct rlimit rlimit;
+
+  getrlimit (RLIMIT_AS, &rlimit);
+  if (rlimit.rlim_cur == RLIM_INFINITY)
+    lim_data = -1;
+  else
+    lim_data = rlimit.rlim_cur;
+}
+
+#else /* not HAVE_GETRLIMIT */
+
 #ifdef USG
 
 static void
@@ -137,6 +152,7 @@
 #endif /* BSD4_2 */
 #endif /* not WINDOWSNT */
 #endif /* not USG */
+#endif /* not HAVE_GETRLIMIT */
 #endif /* not NO_LIM_DATA */
 
 /* Verify amount of memory available, complaining if we're near the end. */
@@ -154,21 +170,6 @@
   unsigned long data_size;
   enum warnlevel new_warnlevel;
 
-  /* Cygwin has a faulty getrlimit implementation:
-     http://lists.gnu.org/archive/html/emacs-devel/2008-08/msg00125.html  */
-#if defined (HAVE_GETRLIMIT) && ! defined (CYGWIN)
-  struct rlimit rlimit;
-
-  getrlimit (RLIMIT_AS, &rlimit);
-  if (RLIM_INFINITY == rlimit.rlim_max
-      /* This is a nonsensical case, but it happens -- rms.  */
-      || rlimit.rlim_cur > rlimit.rlim_max)
-    return;
-  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;
@@ -182,8 +183,6 @@
   cp = (char *) (*__morecore) (0);
   data_size = (char *) cp - (char *) data_space_start;
 
-#endif /* not HAVE_GETRLIMIT */
-
   if (!warn_function)
     return;
 
@@ -229,10 +228,8 @@
        warnlevel = warned_85;
     }
 
-#if ! defined (HAVE_GETRLIMIT) || defined (CYGWIN)
   if (EXCEEDS_LISP_PTR (cp))
     (*warn_function) ("Warning: memory in use exceeds lisp pointer size");
-#endif
 }
 
 /* Enable memory usage warnings.




reply via email to

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