diff options
author | Roland McGrath <roland@gnu.org> | 1992-10-15 23:29:28 +0000 |
---|---|---|
committer | Roland McGrath <roland@gnu.org> | 1992-10-15 23:29:28 +0000 |
commit | c344d473d6acf4f3627d874ea7f77539d785142f (patch) | |
tree | a61853f97579a26d6a6087577a048c84bc26ddce | |
parent | 9323f0b8182ad8ce98698580f0df40217846574a (diff) | |
download | emacs-c344d473d6acf4f3627d874ea7f77539d785142f.tar.gz |
(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.
-rw-r--r-- | src/vm-limit.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/vm-limit.c b/src/vm-limit.c index ea99ebdae9b..c3bd98d67de 100644 --- a/src/vm-limit.c +++ b/src/vm-limit.c @@ -44,13 +44,10 @@ static int warnlevel; 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 @@ morecore_with_warning (size) 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 @@ morecore_with_warning (size) 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 @@ memory_warnings (start, warnfun) 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 @@ memory_warnings (start, warnfun) data_space_start = start_of_data (); warn_function = warnfun; - __morecore = &morecore_with_warning; + __after_morecore_hook = check_memory_limits; } |