changeset 1416:60bb5e719468

(morecore_with_warning): Removed. (check_memory_limits): New fn; most code from morecore_with_warning, but only checks limits, doesn't do any work. (memory_warnings): Set __after_morecore_hook to check_memory_limits; don't set __morecore.
author Roland McGrath <roland@gnu.org>
date Thu, 15 Oct 1992 23:29:28 +0000
parents 1b82f79c4eb4
children 3a1576d52874
files src/vm-limit.c
diffstat 1 files changed, 5 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/vm-limit.c	Thu Oct 15 21:06:27 1992 +0000
+++ b/src/vm-limit.c	Thu Oct 15 23:29:28 1992 +0000
@@ -44,13 +44,10 @@
    0 means don't issue them.  */
 static void (*warn_function) ();
 
-extern POINTER sbrk ();
-
 /* Get more memory space, complaining if we're near the end. */
 
-static POINTER
-morecore_with_warning (size)
-     register int size;
+static void
+check_memory_limits ()
 {
   POINTER result;
   register POINTER cp;
@@ -62,7 +59,7 @@
   five_percent = lim_data / 20;
 
   /* Find current end of memory and issue warning if getting near max */
-  cp = sbrk (0);
+  cp = (char *) (*__morecore) (0);
   data_size = (char *) cp - (char *) data_space_start;
 
   if (warn_function)
@@ -112,11 +109,6 @@
 
   if (EXCEEDS_LISP_PTR (cp))
     (*warn_function) ("Warning: memory in use exceeds lisp pointer size");
-
-  result = sbrk (size);
-  if (result == (POINTER) -1)
-    return NULL;
-  return result;
 }
 
 /* Cause reinitialization based on job parameters;
@@ -127,7 +119,7 @@
      POINTER start;
      void (*warnfun) ();
 {
-  extern POINTER (* __morecore) ();     /* From gmalloc.c */
+  extern void (* __after_morecore_hook) ();     /* From gmalloc.c */
 
   if (start)
     data_space_start = start;
@@ -135,5 +127,5 @@
     data_space_start = start_of_data ();
 
   warn_function = warnfun;
-  __morecore = &morecore_with_warning;
+  __after_morecore_hook = check_memory_limits;
 }