use Error instead of Abort

Fix annoying 16MB limit


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@235 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2001-12-18 16:17:26 +00:00
parent 6ca40989fa
commit 7e22cb486f

View File

@ -145,8 +145,10 @@ typedef struct idb_queue
#define IDB_LINK_TABLE 1 #define IDB_LINK_TABLE 1
#if LARGE_IDB_LINK_TABLE #if LARGE_IDB_LINK_TABLE
typedef BITS32 link_entry; typedef BITS32 link_entry;
#define SIZEOF_LINK_ENTRY 4
#else #else
typedef BITS16 link_entry; typedef BITS16 link_entry;
#define SIZEOF_LINK_ENTRY 2
#endif #endif
/* a second alternative is to just use a tag */ /* a second alternative is to just use a tag */
/*#define IDB_USE_MBIT 1*/ /*#define IDB_USE_MBIT 1*/
@ -1400,21 +1402,15 @@ CreateDBStruct(Term Tm, DBProp p, int InFlag)
flag |= DBWithRefs; flag |= DBWithRefs;
} }
#ifdef IDB_LINK_TABLE #ifdef IDB_LINK_TABLE
#if SIZEOF_SHORT_INT==4 #if SIZEOF_LINK_ENTRY==2
if (Unsigned(CodeAbs) >= 0x400000000) {
#else
if (Unsigned(CodeAbs) >= 0x40000) { if (Unsigned(CodeAbs) >= 0x40000) {
#endif
DBErrorFlag = OTHER_ERROR_IN_DB; DBErrorFlag = OTHER_ERROR_IN_DB;
DBErrorNumber = SYSTEM_ERROR; DBErrorNumber = SYSTEM_ERROR;
DBErrorTerm = TermNil; DBErrorTerm = TermNil;
#if SIZEOF_SHORT_INT==4
DBErrorMsg = "trying to store term larger than 256KB"; DBErrorMsg = "trying to store term larger than 256KB";
#else
DBErrorMsg = "trying to store term larger than 16MB";
#endif
return(NULL); return(NULL);
} }
#endif
#endif #endif
pp = AllocDBSpace(DBLength(CodeAbs)); pp = AllocDBSpace(DBLength(CodeAbs));
if (pp == NIL) { if (pp == NIL) {
@ -1639,16 +1635,16 @@ p_rcda(void)
return (unify(ARG3, TRef)); return (unify(ARG3, TRef));
case SOVF_ERROR_IN_DB: case SOVF_ERROR_IN_DB:
if (!gc(3, ENV, P)) { if (!gc(3, ENV, P)) {
Abort("[ SYSTEM ERROR: YAP could not grow stack in recorda/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow stack in recorda/3");
return(FALSE); return(FALSE);
} }
goto recover_record; goto recover_record;
case TOVF_ERROR_IN_DB: case TOVF_ERROR_IN_DB:
Abort("[ SYSTEM ERROR: YAP could not grow trail in recorda/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow trail in recorda/3");
return(FALSE); return(FALSE);
case OVF_ERROR_IN_DB: case OVF_ERROR_IN_DB:
if (!growheap(FALSE)) { if (!growheap(FALSE)) {
Abort("[ SYSTEM ERROR: YAP could not grow heap in recorda/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow heap in recorda/3");
return(FALSE); return(FALSE);
} else } else
goto recover_record; goto recover_record;
@ -1678,16 +1674,16 @@ p_rcdap(void)
return (unify(ARG3, TRef)); return (unify(ARG3, TRef));
case SOVF_ERROR_IN_DB: case SOVF_ERROR_IN_DB:
if (!gc(3, ENV, P)) { if (!gc(3, ENV, P)) {
Abort("[ SYSTEM ERROR: YAP could not grow stack in recorda/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow stack in recorda/3");
return(FALSE); return(FALSE);
} }
goto recover_record; goto recover_record;
case TOVF_ERROR_IN_DB: case TOVF_ERROR_IN_DB:
Abort("[ SYSTEM ERROR: YAP could not grow trail in recorda/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow trail in recorda/3");
return(FALSE); return(FALSE);
case OVF_ERROR_IN_DB: case OVF_ERROR_IN_DB:
if (!growheap(FALSE)) { if (!growheap(FALSE)) {
Abort("[ SYSTEM ERROR: YAP could not grow heap in recorda/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow heap in recorda/3");
return(FALSE); return(FALSE);
} else } else
goto recover_record; goto recover_record;
@ -1717,16 +1713,16 @@ p_rcdz(void)
return (unify(ARG3, TRef)); return (unify(ARG3, TRef));
case SOVF_ERROR_IN_DB: case SOVF_ERROR_IN_DB:
if (!gc(3, ENV, P)) { if (!gc(3, ENV, P)) {
Abort("[ SYSTEM ERROR: YAP could not grow stack in recordz/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow stack in recordz/3");
return(FALSE); return(FALSE);
} }
goto recover_record; goto recover_record;
case TOVF_ERROR_IN_DB: case TOVF_ERROR_IN_DB:
Abort("[ SYSTEM ERROR: YAP could not grow trail in recorda/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow trail in recorda/3");
return(FALSE); return(FALSE);
case OVF_ERROR_IN_DB: case OVF_ERROR_IN_DB:
if (!growheap(FALSE)) { if (!growheap(FALSE)) {
Abort("[ SYSTEM ERROR: YAP could not grow heap in recordz/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow heap in recordz/3");
return(FALSE); return(FALSE);
} else } else
goto recover_record; goto recover_record;
@ -1756,16 +1752,16 @@ p_rcdzp(void)
return (unify(ARG3, TRef)); return (unify(ARG3, TRef));
case SOVF_ERROR_IN_DB: case SOVF_ERROR_IN_DB:
if (!gc(3, ENV, P)) { if (!gc(3, ENV, P)) {
Abort("[ SYSTEM ERROR: YAP could not grow stack in recordz/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow stack in recordz/3");
return(FALSE); return(FALSE);
} }
goto recover_record; goto recover_record;
case TOVF_ERROR_IN_DB: case TOVF_ERROR_IN_DB:
Abort("[ SYSTEM ERROR: YAP could not grow trail in recorda/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow trail in recorda/3");
return(FALSE); return(FALSE);
case OVF_ERROR_IN_DB: case OVF_ERROR_IN_DB:
if (!growheap(FALSE)) { if (!growheap(FALSE)) {
Abort("[ SYSTEM ERROR: YAP could not grow heap in recordz/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow heap in recordz/3");
return(FALSE); return(FALSE);
} else } else
goto recover_record; goto recover_record;
@ -1803,16 +1799,16 @@ p_rcdstatp(void)
return (unify(ARG4,TRef)); return (unify(ARG4,TRef));
case SOVF_ERROR_IN_DB: case SOVF_ERROR_IN_DB:
if (!gc(3, ENV, P)) { if (!gc(3, ENV, P)) {
Abort("[ SYSTEM ERROR: YAP could not grow stack in record_stat_source/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow stack in record_stat_source/3");
return(FALSE); return(FALSE);
} }
goto recover_record; goto recover_record;
case TOVF_ERROR_IN_DB: case TOVF_ERROR_IN_DB:
Abort("[ SYSTEM ERROR: YAP could not grow trail in record_stat_source/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow trail in record_stat_source/3");
return(FALSE); return(FALSE);
case OVF_ERROR_IN_DB: case OVF_ERROR_IN_DB:
if (!growheap(FALSE)) { if (!growheap(FALSE)) {
Abort("[ SYSTEM ERROR: YAP could not grow heap in record_stat_source/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow heap in record_stat_source/3");
return(FALSE); return(FALSE);
} else } else
goto recover_record; goto recover_record;
@ -1845,16 +1841,16 @@ p_drcdap(void)
return (unify(ARG3, TRef)); return (unify(ARG3, TRef));
case SOVF_ERROR_IN_DB: case SOVF_ERROR_IN_DB:
if (!gc(4, ENV, P)) { if (!gc(4, ENV, P)) {
Abort("[ SYSTEM ERROR: YAP could not grow stack in recorda/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow stack in recorda/3");
return(FALSE); return(FALSE);
} }
goto recover_record; goto recover_record;
case TOVF_ERROR_IN_DB: case TOVF_ERROR_IN_DB:
Abort("[ SYSTEM ERROR: YAP could not grow trail in recorda/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow trail in recorda/3");
return(FALSE); return(FALSE);
case OVF_ERROR_IN_DB: case OVF_ERROR_IN_DB:
if (!growheap(FALSE)) { if (!growheap(FALSE)) {
Abort("[ SYSTEM ERROR: YAP could not grow heap in recorda/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow heap in recorda/3");
return(FALSE); return(FALSE);
} else } else
goto recover_record; goto recover_record;
@ -1888,16 +1884,16 @@ p_drcdzp(void)
return (unify(ARG3, TRef)); return (unify(ARG3, TRef));
case SOVF_ERROR_IN_DB: case SOVF_ERROR_IN_DB:
if (!gc(4, ENV, P)) { if (!gc(4, ENV, P)) {
Abort("[ SYSTEM ERROR: YAP could not grow stack in recordz/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow stack in recordz/3");
return(FALSE); return(FALSE);
} }
goto recover_record; goto recover_record;
case TOVF_ERROR_IN_DB: case TOVF_ERROR_IN_DB:
Abort("[ SYSTEM ERROR: YAP could not grow trail in recorda/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow trail in recorda/3");
return(FALSE); return(FALSE);
case OVF_ERROR_IN_DB: case OVF_ERROR_IN_DB:
if (!growheap(FALSE)) { if (!growheap(FALSE)) {
Abort("[ SYSTEM ERROR: YAP could not grow heap in recordz/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow heap in recordz/3");
return(FALSE); return(FALSE);
} else } else
goto recover_record; goto recover_record;
@ -1933,16 +1929,16 @@ p_rcdaifnot(void)
return (unify(ARG3, TRef)); return (unify(ARG3, TRef));
case SOVF_ERROR_IN_DB: case SOVF_ERROR_IN_DB:
if (!gc(3, ENV, P)) { if (!gc(3, ENV, P)) {
Abort("[ SYSTEM ERROR: YAP could not grow stack in recordaifnot/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow stack in recordaifnot/3");
return(FALSE); return(FALSE);
} }
goto recover_record; goto recover_record;
case TOVF_ERROR_IN_DB: case TOVF_ERROR_IN_DB:
Abort("[ SYSTEM ERROR: YAP could not grow trail in recorda/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow trail in recorda/3");
return(FALSE); return(FALSE);
case OVF_ERROR_IN_DB: case OVF_ERROR_IN_DB:
if (!growheap(FALSE)) { if (!growheap(FALSE)) {
Abort("[ SYSTEM ERROR: YAP could not grow heap in recordzifnot/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow heap in recordzifnot/3");
return(FALSE); return(FALSE);
} else } else
goto recover_record; goto recover_record;
@ -1975,16 +1971,16 @@ p_rcdzifnot(void)
return (unify(ARG3, TRef)); return (unify(ARG3, TRef));
case SOVF_ERROR_IN_DB: case SOVF_ERROR_IN_DB:
if (!gc(3, ENV, P)) { if (!gc(3, ENV, P)) {
Abort("[ SYSTEM ERROR: YAP could not grow stack in recordaifnot/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow stack in recordaifnot/3");
return(FALSE); return(FALSE);
} }
goto recover_record; goto recover_record;
case TOVF_ERROR_IN_DB: case TOVF_ERROR_IN_DB:
Abort("[ SYSTEM ERROR: YAP could not grow trail in recorda/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow trail in recorda/3");
return(FALSE); return(FALSE);
case OVF_ERROR_IN_DB: case OVF_ERROR_IN_DB:
if (!growheap(FALSE)) { if (!growheap(FALSE)) {
Abort("[ SYSTEM ERROR: YAP could not grow heap in recordzifnot/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow heap in recordzifnot/3");
return(FALSE); return(FALSE);
} else } else
goto recover_record; goto recover_record;
@ -2299,7 +2295,7 @@ i_log_upd_recorded(LogUpdDBProp AtProp)
if (AtProp->Index == NULL) { if (AtProp->Index == NULL) {
if((AtProp->Index = new_lu_index(AtProp)) == NULL) { if((AtProp->Index = new_lu_index(AtProp)) == NULL) {
if (!growheap(FALSE)) { if (!growheap(FALSE)) {
Abort("[ SYSTEM ERROR: YAP failed to reserve space in growheap ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP failed to reserve space in growheap");
cut_fail(); cut_fail();
} }
twork = Deref(ARG2); twork = Deref(ARG2);
@ -3864,21 +3860,21 @@ StoreTermInDB(Term t, int nargs)
switch(DBErrorFlag) { switch(DBErrorFlag) {
case NO_ERROR_IN_DB: case NO_ERROR_IN_DB:
#ifdef DEBUG #ifdef DEBUG
Abort("[ SYSTEM ERROR: no error but null return in enqueue/2 ]\n"); Error(SYSTEM_ERROR, TermNil, "no error but null return in enqueue/2");
#endif #endif
break; break;
case SOVF_ERROR_IN_DB: case SOVF_ERROR_IN_DB:
if (!gc(nargs, ENV, P)) { if (!gc(nargs, ENV, P)) {
Abort("[ SYSTEM ERROR: YAP could not grow stack in enqueue/2 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow stack in enqueue/2");
return(FALSE); return(FALSE);
} else } else
break; break;
case TOVF_ERROR_IN_DB: case TOVF_ERROR_IN_DB:
Abort("[ SYSTEM ERROR: YAP could not grow trail in recorda/3 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow trail in recorda/3");
return(FALSE); return(FALSE);
case OVF_ERROR_IN_DB: case OVF_ERROR_IN_DB:
if (!growheap(FALSE)) { if (!growheap(FALSE)) {
Abort("[ SYSTEM ERROR: YAP could not grow heap in enqueue/2 ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP could not grow heap in enqueue/2");
return(FALSE); return(FALSE);
} else } else
break; break;
@ -3902,7 +3898,7 @@ p_init_queue(void)
} else { } else {
while ((dbq = (db_queue *)AllocDBSpace(sizeof(db_queue))) == NULL) { while ((dbq = (db_queue *)AllocDBSpace(sizeof(db_queue))) == NULL) {
if (!growheap(FALSE)) { if (!growheap(FALSE)) {
Abort("[ SYSTEM ERROR: YAP failed to reserve space in growheap ]\n"); Error(SYSTEM_ERROR, TermNil, "YAP failed to reserve space in growheap");
return(FALSE); return(FALSE);
} }
} }