summaryrefslogtreecommitdiff
path: root/src/vm-limit.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1992-10-15 23:29:28 +0000
committerRoland McGrath <roland@gnu.org>1992-10-15 23:29:28 +0000
commitfd0654667e6844ad235e5c2647960f778ce724c7 (patch)
treee10f8b8bd2b55d4b7b7cfc7c29f972ee0be17a59 /src/vm-limit.c
parent4e7d5543d9421a3699af78abd5859bfddec79552 (diff)
downloademacs-fd0654667e6844ad235e5c2647960f778ce724c7.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.
Diffstat (limited to 'src/vm-limit.c')
-rw-r--r--src/vm-limit.c18
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;
}