From: Karl Heuer Date: Sat, 27 Sep 1997 16:01:00 +0000 (+0000) Subject: (relinquish): When returning memory to the system, X-Git-Tag: emacs-20.3~3074 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=21532667504895f38a433d23f27bdcad9f989dd5;p=emacs.git (relinquish): When returning memory to the system, watch out for the original data segment boundary. --- diff --git a/src/ralloc.c b/src/ralloc.c index d1ce3be24fc..183db755412 100644 --- a/src/ralloc.c +++ b/src/ralloc.c @@ -363,7 +363,18 @@ relinquish () } if ((*real_morecore) (- excess) == 0) - abort (); + { + /* If the system didn't want that much memory back, adjust + the end of the last heap to reflect that. This can occur + if break_value is still within the original data segment. */ + last_heap->end += excess; + /* Make sure that the result of the adjustment is accurate. + It should be, for the else clause above; the other case, + which returns the entire last heap to the system, seems + unlikely to trigger this mode of failure. */ + if (last_heap->end != (*real_morecore) (0)) + abort (); + } } }