# HG changeset patch # User Karl Heuer # Date 875376060 0 # Node ID cc8daec6d363e0794e982548ff59fcd468e85a71 # Parent b93ac48bafd1c43e5c9ec1944a3433bc33a1b455 (relinquish): When returning memory to the system, watch out for the original data segment boundary. diff -r b93ac48bafd1 -r cc8daec6d363 src/ralloc.c --- a/src/ralloc.c Fri Sep 26 21:39:10 1997 +0000 +++ b/src/ralloc.c Sat Sep 27 16:01:00 1997 +0000 @@ -363,7 +363,18 @@ } 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 (); + } } }