we don't always expand stack on attvar overflow.
This commit is contained in:
parent
17e36dbda1
commit
a1203e56dd
14
C/grow.c
14
C/grow.c
@ -748,12 +748,17 @@ static_growglobal(long request, CELL **ptr, CELL *hsplit)
|
|||||||
else if (hsplit == (CELL *)omax)
|
else if (hsplit == (CELL *)omax)
|
||||||
hsplit = NULL;
|
hsplit = NULL;
|
||||||
if (size < 0 ||
|
if (size < 0 ||
|
||||||
(size+H < ASP-4096 &&
|
(Unsigned(H)+size < Unsigned(ASP)-CreepFlag &&
|
||||||
hsplit > H0)) {
|
hsplit > H0)) {
|
||||||
/* don't need to expand stacks */
|
/* don't need to expand stacks */
|
||||||
insert_in_delays = FALSE;
|
insert_in_delays = FALSE;
|
||||||
do_grow = FALSE;
|
do_grow = FALSE;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (Unsigned(H)+size < Unsigned(ASP)-CreepFlag) {
|
||||||
|
/* we can just ask for more room */
|
||||||
|
do_grow = FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (do_grow) {
|
if (do_grow) {
|
||||||
if (size < YAP_ALLOC_SIZE)
|
if (size < YAP_ALLOC_SIZE)
|
||||||
@ -820,8 +825,13 @@ static_growglobal(long request, CELL **ptr, CELL *hsplit)
|
|||||||
/* now, remember we have delay -- global with a hole in delay or a
|
/* now, remember we have delay -- global with a hole in delay or a
|
||||||
hole in global */
|
hole in global */
|
||||||
if (!hsplit) {
|
if (!hsplit) {
|
||||||
|
if (!do_grow) {
|
||||||
|
DelayDiff = GDiff = GDiff0 = size;
|
||||||
|
request = 0L;
|
||||||
|
} else {
|
||||||
/* expand delay stack */
|
/* expand delay stack */
|
||||||
DelayDiff = GDiff = GDiff0 = LDiff;
|
DelayDiff = GDiff = GDiff0 = LDiff;
|
||||||
|
}
|
||||||
} else if (insert_in_delays) {
|
} else if (insert_in_delays) {
|
||||||
/* we want to expand a hole for the delay stack */
|
/* we want to expand a hole for the delay stack */
|
||||||
DelayDiff = size-request;
|
DelayDiff = size-request;
|
||||||
@ -842,6 +852,8 @@ static_growglobal(long request, CELL **ptr, CELL *hsplit)
|
|||||||
} else {
|
} else {
|
||||||
MoveExpandedGlobal();
|
MoveExpandedGlobal();
|
||||||
}
|
}
|
||||||
|
} else if (!hsplit) {
|
||||||
|
MoveExpandedGlobal();
|
||||||
}
|
}
|
||||||
/* don't run through garbage */
|
/* don't run through garbage */
|
||||||
if (hsplit && (OldH != hsplit)) {
|
if (hsplit && (OldH != hsplit)) {
|
||||||
|
Reference in New Issue
Block a user