don't give up if you don't have enough space to expand the consult stack.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@390 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2002-02-27 02:10:01 +00:00
parent 499adf4cf4
commit ec2e474e5c

View File

@ -715,10 +715,11 @@ static void expand_consult(void)
/* now double consult capacity */ /* now double consult capacity */
ConsultCapacity += InitialConsultCapacity; ConsultCapacity += InitialConsultCapacity;
/* I assume it always works ;-) */ /* I assume it always works ;-) */
new_cl = (consult_obj *)AllocCodeSpace(sizeof(consult_obj)*ConsultCapacity); while ((new_cl = (consult_obj *)AllocCodeSpace(sizeof(consult_obj)*ConsultCapacity)) == NULL) {
if (new_cl == NULL) { if (!growheap(FALSE)) {
Error(SYSTEM_ERROR,TermNil,"Could not expand consult space: Heap crashed against Stacks"); Error(SYSTEM_ERROR,TermNil,"Could not expand consult space: Heap crashed against Stacks");
return; return;
}
} }
new_cs = new_cl + (InitialConsultCapacity+1); new_cs = new_cl + (InitialConsultCapacity+1);
new_cb = new_cs + (ConsultBase-ConsultSp); new_cb = new_cs + (ConsultBase-ConsultSp);