]> code.delx.au - gnu-emacs/blobdiff - src/vm-limit.c
(url-current-object, url-package-name, url-package-version): Add defvars.
[gnu-emacs] / src / vm-limit.c
index eb43e836bae62b2528b0e3d43d6fdeb5ff02226b..0c12dec9b046a911d8ff4726b3956e1dac5e24f4 100644 (file)
@@ -1,5 +1,6 @@
 /* Functions for memory limit warnings.
-   Copyright (C) 1990, 1992 Free Software Foundation, Inc.
+   Copyright (C) 1990, 1992, 2002, 2003, 2004,
+                 2005 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -15,8 +16,8 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public License
 along with GNU Emacs; see the file COPYING.  If not, write to
-the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 #ifdef emacs
 #include <config.h>
@@ -50,8 +51,12 @@ static void (*warn_function) ();
 static void
 check_memory_limits ()
 {
+#ifdef REL_ALLOC
+  extern POINTER (*real_morecore) ();
+#endif
   extern POINTER (*__morecore) ();
 
+
   register POINTER cp;
   unsigned long five_percent;
   unsigned long data_size;
@@ -61,13 +66,18 @@ check_memory_limits ()
   five_percent = lim_data / 20;
 
   /* Find current end of memory and issue warning if getting near max */
+#ifdef REL_ALLOC
+  if (real_morecore)
+    cp = (char *) (*real_morecore) (0);
+  else
+#endif
   cp = (char *) (*__morecore) (0);
   data_size = (char *) cp - (char *) data_space_start;
 
   if (warn_function)
     switch (warnlevel)
       {
-      case 0: 
+      case 0:
        if (data_size > five_percent * 15)
          {
            warnlevel++;
@@ -75,7 +85,7 @@ check_memory_limits ()
          }
        break;
 
-      case 1: 
+      case 1:
        if (data_size > five_percent * 17)
          {
            warnlevel++;
@@ -83,7 +93,7 @@ check_memory_limits ()
          }
        break;
 
-      case 2: 
+      case 2:
        if (data_size > five_percent * 19)
          {
            warnlevel++;
@@ -136,3 +146,6 @@ memory_warnings (start, warnfun)
   lim_data = 0;
 #endif
 }
+
+/* arch-tag: eab04eda-1f69-447a-8d9f-95f0a3983ca5
+   (do not change this comment) */