growglobal would core dump over holes.
This commit is contained in:
parent
f10dde5b90
commit
adb25ff96f
15
C/grow.c
15
C/grow.c
|
@ -813,10 +813,17 @@ static_growglobal(long request, CELL **ptr, CELL *hsplit)
|
||||||
YAPEnterCriticalSection();
|
YAPEnterCriticalSection();
|
||||||
/* we always shift the local and the stack by the same amount */
|
/* we always shift the local and the stack by the same amount */
|
||||||
if (do_grow) {
|
if (do_grow) {
|
||||||
/* This is what happens to the base of the stack */
|
/* we got over a hole */
|
||||||
BaseDiff = Yap_GlobalBase-old_GlobalBase;
|
if (minimal_request) {
|
||||||
/* if we grow, we need to move the stacks */
|
/* we went over a hole */
|
||||||
LDiff = TrDiff = size+BaseDiff;
|
BaseDiff = size+((CELL)Yap_TrailTop-(CELL)Yap_GlobalBase)-minimal_request;
|
||||||
|
LDiff = TrDiff = size;
|
||||||
|
} else {
|
||||||
|
/* we may still have an overflow */
|
||||||
|
BaseDiff = Yap_GlobalBase != old_GlobalBase;
|
||||||
|
/* if we grow, we need to move the stacks */
|
||||||
|
LDiff = TrDiff = BaseDiff+size;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
/* stay still */
|
/* stay still */
|
||||||
LDiff = TrDiff = 0;
|
LDiff = TrDiff = 0;
|
||||||
|
|
Reference in New Issue