Merge branch 'master' of git.dcc.fc.up.pt:yap-6.3

This commit is contained in:
Ricardo Rocha
2012-01-03 16:28:36 +00:00
18 changed files with 255 additions and 164 deletions

View File

@@ -177,7 +177,6 @@ p_rem(Term t1, Term t2) {
{
Int i1 = IntegerOfTerm(t1);
Int i2 = IntegerOfTerm(t2);
Int mod;
if (i2 == 0)
return Yap_ArithError(EVALUATION_ERROR_ZERO_DIVISOR, t2, "X is " Int_FORMAT " rem 0", i1);
@@ -189,7 +188,6 @@ p_rem(Term t1, Term t2) {
"rem/2 with %d and %d", i1, i2);
#endif
}
mod = i1%i2;
RINT(i1%i2);
}
case (CELL)double_e:

View File

@@ -441,6 +441,7 @@ X_API void *STD_PROTO(YAP_ReallocSpaceFromYap,(void*,unsigned int));
X_API void STD_PROTO(YAP_FreeSpaceFromYap,(void *));
X_API int STD_PROTO(YAP_StringToBuffer, (Term, char *, unsigned int));
X_API Term STD_PROTO(YAP_ReadBuffer, (char *,Term *));
X_API Term STD_PROTO(YAP_FloatsToList, (double *, size_t));
X_API Term STD_PROTO(YAP_BufferToString, (char *));
X_API Term STD_PROTO(YAP_NBufferToString, (char *, size_t));
X_API Term STD_PROTO(YAP_WideBufferToString, (wchar_t *));
@@ -966,7 +967,7 @@ YAP_MkPairTerm(Term t1, Term t2)
Term t;
BACKUP_H();
if (H > ASP-1024) {
while (H > ASP-1024) {
Int sl1 = Yap_InitSlot(t1 PASS_REGS);
Int sl2 = Yap_InitSlot(t2 PASS_REGS);
RECOVER_H();
@@ -3538,6 +3539,41 @@ YAP_cwd(void)
return buf;
}
X_API Term
YAP_FloatsToList(double *dblp, size_t sz)
{
CACHE_REGS
Term t;
CELL *oldH;
BACKUP_H();
if (!sz)
return TermNil;
while (ASP-1024 < H + sz*(2+2+SIZEOF_DOUBLE/SIZEOF_LONG_INT)) {
if (dblp > H0 && dblp < H) {
/* we are in trouble */
LOCAL_OpenArray = dblp;
}
if (!dogc( PASS_REGS1 )) {
RECOVER_H();
return 0L;
}
dblp = LOCAL_OpenArray;
LOCAL_OpenArray = NULL;
}
t = AbsPair(H);
while (sz) {
oldH = H;
H +=2;
oldH[0] = MkFloatTerm(*dblp++);
oldH[1] = AbsPair(H);
sz--;
}
oldH[1] = TermNil;
RECOVER_H();
return t;
}
X_API Term
YAP_OpenList(int n)
{
@@ -3545,7 +3581,7 @@ YAP_OpenList(int n)
Term t;
BACKUP_H();
if (H+2*n > ASP-1024) {
while (H+2*n > ASP-1024) {
if (!dogc( PASS_REGS1 )) {
RECOVER_H();
return FALSE;

View File

@@ -1289,7 +1289,7 @@ decrease_log_indices(LogUpdIndex *c, yamop *suspend_code)
{
/* decrease all reference counters */
yamop *beg = c->ClCode, *end, *ipc;
op_numbers op;
if (c->ClFlags & SwitchTableMask) {
CELL *end = (CELL *)((char *)c+c->ClSize);
CELL *beg = (CELL *)(c->ClCode);
@@ -1302,7 +1302,6 @@ decrease_log_indices(LogUpdIndex *c, yamop *suspend_code)
}
return;
}
op = Yap_op_from_opcode(beg->opc);
end = (yamop *)((CODEADDR)c+c->ClSize);
ipc = beg;
cleanup_dangling_indices(ipc, beg, end, suspend_code);
@@ -5431,7 +5430,6 @@ ClauseId(yamop *ipc, PredEntry *pe)
static Int
p_env_info( USES_REGS1 )
{
PredEntry *pe;
CELL *env = LCL0-IntegerOfTerm(Deref(ARG1));
yamop *env_cp;
Term env_b, taddr;
@@ -5441,7 +5439,7 @@ p_env_info( USES_REGS1 )
env_b = MkIntegerTerm((Int)(LCL0-(CELL *)env[E_CB]));
env_cp = (yamop *)env[E_CP];
pe = PREVOP(env_cp,Osbpp)->u.Osbpp.p0;
/* pe = PREVOP(env_cp,Osbpp)->u.Osbpp.p0; */
taddr = MkIntegerTerm((Int)env);
return Yap_unify(ARG3,MkIntegerTerm((Int)env_cp)) &&
Yap_unify(ARG2, taddr) &&

View File

@@ -2759,7 +2759,7 @@ c_layout(compiler_struct *cglobs)
{
PInstr *savepc = cglobs->BodyStart->nextInst;
register Ventry *v = cglobs->vtable;
Int *up = cglobs->Uses, Arity;
Int *up = cglobs->Uses;
CELL *cop = cglobs->Contents;
/* tell put_values used in bip optimisation */
int rn_kills = 0;
@@ -3024,11 +3024,13 @@ c_layout(compiler_struct *cglobs)
checktemp(arg, rn, ic, cglobs);
break;
case safe_call_op:
Arity = RepPredProp((Prop) arg)->ArityOfPE;
/*
vsc: The variables will be in use after this!!!!
for (rn = 1; rn <= Arity; ++rn)
--cglobs->Uses[rn];
{
UInt Arity = RepPredProp((Prop) arg)->ArityOfPE;
for (rn = 1; rn <= Arity; ++rn)
--cglobs->Uses[rn];
}
*/
break;
case call_op:

View File

@@ -4173,11 +4173,9 @@ static void
MyEraseClause(DynamicClause *clau USES_REGS)
{
DBRef ref;
SMALLUNSGN clmask;
if (CL_IN_USE(clau))
return;
clmask = clau->ClFlags;
/*
I don't need to lock the clause at this point because
I am the last one using it anyway.
@@ -5123,7 +5121,6 @@ static Int
p_enqueue( USES_REGS1 )
{
Term Father = Deref(ARG1);
Term t;
QueueEntry *x;
db_queue *father_key;
@@ -5142,7 +5139,6 @@ p_enqueue( USES_REGS1 )
}
}
/* Yap_LUClauseSpace += sizeof(QueueEntry); */
t = Deref(ARG1);
x->DBT = StoreTermInDB(Deref(ARG2), 2 PASS_REGS);
if (x->DBT == NULL) {
return FALSE;
@@ -5163,7 +5159,6 @@ static Int
p_enqueue_unlocked( USES_REGS1 )
{
Term Father = Deref(ARG1);
Term t;
QueueEntry *x;
db_queue *father_key;
@@ -5182,7 +5177,6 @@ p_enqueue_unlocked( USES_REGS1 )
}
}
/* Yap_LUClauseSpace += sizeof(QueueEntry); */
t = Deref(ARG1);
x->DBT = StoreTermInDB(Deref(ARG2), 2 PASS_REGS);
if (x->DBT == NULL) {
return FALSE;

View File

@@ -403,7 +403,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
CELL nt[3];
Functor fun;
int serious;
char *tp = tmpbuf;
int psize = YAP_BUF_SIZE;
LOCAL_Error_TYPE = YAP_NO_ERROR;
@@ -578,7 +577,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = where;
nt[0] = Yap_MkApplTerm(FunctorConsistencyError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -593,7 +591,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomArrayOverflow);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -608,7 +605,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomArrayType);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -623,7 +619,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomIOMode);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -638,7 +633,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomMutable);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -653,7 +647,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomNonEmptyList);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -668,7 +661,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomNotLessThanZero);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -683,7 +675,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomNotNewline);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -698,7 +689,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomNotZero);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -713,7 +703,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomOutOfRange);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -728,7 +717,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomOperatorPriority);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -743,7 +731,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomOperatorSpecifier);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -758,7 +745,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomRadix);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -773,7 +759,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomShiftCountOverflow);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -788,7 +773,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomSourceSink);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -803,7 +787,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomVStream);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -818,7 +801,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomStreamOrAlias);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -833,7 +815,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomEncoding);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -848,7 +829,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomStreamPosition);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -863,7 +843,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomSyntaxErrorHandler);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -878,7 +857,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomTimeOutSpec);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorDomainError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -893,7 +871,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomSourceSink);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorExistenceError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -908,7 +885,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomArray);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorExistenceError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -923,7 +899,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomKey);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorExistenceError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -938,7 +913,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomVStream);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorExistenceError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -953,7 +927,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomVariable);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorExistenceError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -967,7 +940,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomFloatOverflow);
nt[0] = Yap_MkApplTerm(FunctorEvaluationError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -981,7 +953,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomIntOverflow);
nt[0] = Yap_MkApplTerm(FunctorEvaluationError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -995,7 +966,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomUndefined);
nt[0] = Yap_MkApplTerm(FunctorEvaluationError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1009,7 +979,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomFloatUnderflow);
nt[0] = Yap_MkApplTerm(FunctorEvaluationError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1023,7 +992,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomUnderflow);
nt[0] = Yap_MkApplTerm(FunctorEvaluationError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1037,7 +1005,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomZeroDivisor);
nt[0] = Yap_MkApplTerm(FunctorEvaluationError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1049,7 +1016,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
nt[0] = MkAtomTerm(AtomInstantiationError);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1061,7 +1027,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
nt[0] = MkAtomTerm(AtomOperatingSystemError);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1076,7 +1041,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomCodeSpace);
i = strlen(tmpbuf);
nt[0] = Yap_MkApplTerm(FunctorResourceError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1091,7 +1055,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomStack);
nt[0] = Yap_MkApplTerm(FunctorResourceError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1106,7 +1069,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomAttributes);
nt[0] = Yap_MkApplTerm(FunctorResourceError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1119,7 +1081,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
dump_stack( PASS_REGS1 );
i = strlen(tmpbuf);
tp = tmpbuf+i;
ti[0] = MkAtomTerm(AtomUnificationStack);
nt[0] = Yap_MkApplTerm(FunctorResourceError, 1, ti);
psize -= i;
@@ -1136,7 +1097,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomTrail);
nt[0] = Yap_MkApplTerm(FunctorResourceError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1152,7 +1112,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[1] = MkAtomTerm(AtomPrivateProcedure);
ti[2] = where;
nt[0] = Yap_MkApplTerm(FunctorPermissionError, 3, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1168,7 +1127,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[1] = MkAtomTerm(AtomArray);
ti[2] = where;
nt[0] = Yap_MkApplTerm(FunctorPermissionError, 3, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1184,7 +1142,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[1] = MkAtomTerm(AtomOperator);
ti[2] = where;
nt[0] = Yap_MkApplTerm(FunctorPermissionError, 3, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1200,7 +1157,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[1] = MkAtomTerm(AtomBinaryStream);
ti[2] = where;
nt[0] = Yap_MkApplTerm(FunctorPermissionError, 3, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1216,7 +1172,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[1] = MkAtomTerm(AtomPastEndOfStream);
ti[2] = where;
nt[0] = Yap_MkApplTerm(FunctorPermissionError, 3, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1232,7 +1187,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[1] = MkAtomTerm(AtomVStream);
ti[2] = where;
nt[0] = Yap_MkApplTerm(FunctorPermissionError, 3, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1248,7 +1202,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[1] = MkAtomTerm(AtomTextStream);
ti[2] = where;
nt[0] = Yap_MkApplTerm(FunctorPermissionError, 3, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1264,7 +1217,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[1] = MkAtomTerm(AtomStaticProcedure);
ti[2] = where;
nt[0] = Yap_MkApplTerm(FunctorPermissionError, 3, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1280,7 +1232,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[1] = MkAtomTerm(AtomAlias);
ti[2] = where;
nt[0] = Yap_MkApplTerm(FunctorPermissionError, 3, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1296,7 +1247,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[1] = MkAtomTerm(AtomSourceSink);
ti[2] = where;
nt[0] = Yap_MkApplTerm(FunctorPermissionError, 3, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1312,7 +1262,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[1] = MkAtomTerm(AtomBinaryStream);
ti[2] = where;
nt[0] = Yap_MkApplTerm(FunctorPermissionError, 3, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1328,7 +1277,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[1] = MkAtomTerm(AtomVStream);
ti[2] = where;
nt[0] = Yap_MkApplTerm(FunctorPermissionError, 3, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1344,7 +1292,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[1] = MkAtomTerm(AtomTextStream);
ti[2] = where;
nt[0] = Yap_MkApplTerm(FunctorPermissionError, 3, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1360,7 +1307,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[1] = MkAtomTerm(AtomVStream);
ti[2] = where;
nt[0] = Yap_MkApplTerm(FunctorPermissionError, 3, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1376,7 +1322,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[1] = MkAtomTerm(AtomArray);
ti[2] = where;
nt[0] = Yap_MkApplTerm(FunctorPermissionError, 3, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1390,7 +1335,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomCharacter);
nt[0] = Yap_MkApplTerm(FunctorRepresentationError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1404,7 +1348,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomCharacterCode);
nt[0] = Yap_MkApplTerm(FunctorRepresentationError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1418,7 +1361,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomMaxArity);
nt[0] = Yap_MkApplTerm(FunctorRepresentationError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1432,7 +1374,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomVariable);
nt[0] = Yap_MkApplTerm(FunctorRepresentationError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1446,7 +1387,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomStreams);
nt[0] = Yap_MkApplTerm(FunctorResourceError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1460,7 +1400,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomStack);
nt[0] = Yap_MkApplTerm(FunctorResourceError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1474,7 +1413,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
ti[0] = MkAtomTerm(AtomHugeInt);
nt[0] = Yap_MkApplTerm(FunctorResourceError, 1, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1486,7 +1424,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
nt[0] = where;
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1498,7 +1435,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
nt[0] = MkAtomTerm(AtomSystemError);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1510,7 +1446,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
nt[0] = MkAtomTerm(AtomInternalCompilerError);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1525,7 +1460,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomArray);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1540,7 +1474,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomAtom);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1555,7 +1488,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomAtomic);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1570,7 +1502,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomByte);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1585,7 +1516,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomCallable);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1600,7 +1530,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomChar);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1615,7 +1544,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomCharacter);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1630,7 +1558,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomCompound);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1645,7 +1572,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomDBReference);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1660,7 +1586,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomDBTerm);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1675,7 +1600,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomEvaluable);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1690,7 +1614,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomFloat);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1705,7 +1628,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomInteger);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1720,7 +1642,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomKey);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1735,7 +1656,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomList);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1750,7 +1670,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomNumber);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1765,7 +1684,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomPredicateIndicator);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1780,7 +1698,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomPointer);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1795,7 +1712,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomString);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1810,7 +1726,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomUnsignedByte);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1825,7 +1740,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomUnsignedChar);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1840,7 +1754,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
ti[0] = MkAtomTerm(AtomVariable);
ti[1] = where;
nt[0] = Yap_MkApplTerm(FunctorTypeError, 2, ti);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;
@@ -1852,7 +1765,6 @@ Yap_Error(yap_error_number type, Term where, char *format,...)
i = strlen(tmpbuf);
nt[0] = MkAtomTerm(AtomSystemError);
tp = tmpbuf+i;
psize -= i;
fun = FunctorError;
serious = TRUE;

View File

@@ -158,6 +158,8 @@ SetHeapRegs(int copying_threads USES_REGS)
#endif
if (HB)
HB = PtoGloAdjust(HB);
if (LOCAL_OpenArray)
LOCAL_OpenArray = PtoGloAdjust(LOCAL_OpenArray);
if (B)
B = ChoicePtrAdjust(B);
#ifdef TABLING
@@ -1361,13 +1363,11 @@ static int
growatomtable( USES_REGS1 )
{
AtomHashEntry *ntb;
UInt diff = 3*AtomHashTableSize-1, nsize;
UInt nsize = 3*AtomHashTableSize-1;
UInt start_growth_time = Yap_cputime(), growth_time;
int gc_verbose = Yap_is_gc_verbose();
if (diff > 4*1024*1024)
diff = 4*1024*1024+7919;
else
nsize = nsize+7919;
if (nsize -AtomHashTableSize > 4*1024*1024)
nsize = AtomHashTableSize+4*1024*1024+7919;
LOCK(LOCAL_SignalLock);
if (LOCAL_ActiveSignals == YAP_CDOVF_SIGNAL) {

View File

@@ -3438,6 +3438,16 @@ compact_heap( USES_REGS1 )
*dest++ = *current++;
}
*old_dest = *current;
/* if we have are calling from the C-interface,
we may have an open array when we start the gc */
if (LOCAL_OpenArray) {
CELL *start = current + (dest-old_dest);
if (LOCAL_OpenArray < current &&
LOCAL_OpenArray > start) {
UInt off = LOCAL_OpenArray-start;
LOCAL_OpenArray = old_dest+off;
}
}
*dest++ = EndSpecials;
#ifdef DEBUG
found_marked += (dest-old_dest);