]> git.eshelyaron.com Git - emacs.git/commitdiff
(relinquish): When returning memory to the system,
authorKarl Heuer <kwzh@gnu.org>
Sat, 27 Sep 1997 16:01:00 +0000 (16:01 +0000)
committerKarl Heuer <kwzh@gnu.org>
Sat, 27 Sep 1997 16:01:00 +0000 (16:01 +0000)
watch out for the original data segment boundary.

src/ralloc.c

index d1ce3be24fc4e6ee26a9d3f82ebbaeab76c37519..183db755412fd663d56ef8f290c11572d6ea7434 100644 (file)
@@ -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 ();
+       }
     }
 }