# HG changeset patch # User Roland McGrath # Date 719191768 0 # Node ID 60bb5e719468b3bbc59ea56f5556d96ef9d891d4 # Parent 1b82f79c4eb4404343b321b7e81f641579e555f2 (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. diff -r 1b82f79c4eb4 -r 60bb5e719468 src/vm-limit.c --- 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; }