fix static_growglobal.

This commit is contained in:
Vitor Santos Costa 2009-03-24 14:15:40 +00:00
parent bdd625c8ae
commit 2e807fc5c7
1 changed files with 6 additions and 3 deletions

View File

@ -803,10 +803,10 @@ static_growglobal(long request, CELL **ptr, CELL *hsplit)
YAPEnterCriticalSection();
/* we always shift the local and the stack by the same amount */
if (do_grow) {
/* if we grow, we need to move the stacks */
LDiff = TrDiff = size;
/* This is what happens to the base of the stack */
BaseDiff = Yap_GlobalBase-old_GlobalBase;
/* if we grow, we need to move the stacks */
LDiff = TrDiff = size+BaseDiff;
} else {
/* stay still */
LDiff = TrDiff = 0;
@ -814,7 +814,10 @@ static_growglobal(long request, CELL **ptr, CELL *hsplit)
}
/* now, remember we have delay -- global with a hole in delay or a
hole in global */
if (insert_in_delays) {
if (!hsplit) {
/* expand delay stack */
DelayDiff = GDiff = GDiff0 = LDiff;
} else if (insert_in_delays) {
/* we want to expand a hole for the delay stack */
DelayDiff = size-request;
GDiff = GDiff0 = size;