From 2908d4ccbd14ea72d0b17d48ee6013b6edbf93a4 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 12 Mar 2010 22:40:17 +0000 Subject: [PATCH] fix: size of quue went down. --- C/globals.c | 12 ++++++++---- H/iatoms.h | 2 +- misc/ATOMS | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/C/globals.c b/C/globals.c index 05fd9fe39..1bbf726bd 100644 --- a/C/globals.c +++ b/C/globals.c @@ -32,11 +32,15 @@ static char SccsId[] = "%W% %G%"; */ +#define QUEUE_FUNCTOR_ARITY 4 + #define QUEUE_ARENA 0 #define QUEUE_HEAD 1 #define QUEUE_TAIL 2 #define QUEUE_SIZE 3 +#define HEAP_FUNCTOR_MIN_ARITY + #define HEAP_SIZE 0 #define HEAP_MAX 1 #define HEAP_ARENA 2 @@ -1305,7 +1309,7 @@ p_nb_create2(void) static Int nb_queue(UInt arena_sz) { - Term queue_arena, queue, ar[5], *nar; + Term queue_arena, queue, ar[QUEUE_FUNCTOR_ARITY], *nar; Term t = Deref(ARG1); DepthArenas++; @@ -1320,7 +1324,7 @@ nb_queue(UInt arena_sz) ar[QUEUE_TAIL] = ar[QUEUE_SIZE] = MkIntTerm(0); - queue = Yap_MkApplTerm(FunctorNBQueue,5,ar); + queue = Yap_MkApplTerm(FunctorNBQueue,QUEUE_FUNCTOR_ARITY,ar); if (!Yap_unify(queue,ARG1)) return FALSE; if (arena_sz < 4*1024) @@ -1419,7 +1423,7 @@ p_nb_queue_close(void) Term t = Deref(ARG1); Int out; - DepthArenas--; + DepthArenas--; if (!IsVarTerm(t)) { CELL *qp; @@ -1907,7 +1911,7 @@ p_nb_beam(void) hsize = IntegerOfTerm(tsize); } while ((beam = MkZeroApplTerm(Yap_MkFunctor(AtomHeap,5*hsize+HEAP_START+1),5*hsize+HEAP_START+1)) == TermNil) { - if (!Yap_gcl((5*hsize+HEAP_START+1)*sizeof(CELL), 2, ENV, P)) { + if (!Yap_gcl((4*hsize+HEAP_START+1)*sizeof(CELL), 2, ENV, P)) { Yap_Error(OUT_OF_STACK_ERROR, TermNil, Yap_ErrorMessage); return FALSE; } diff --git a/H/iatoms.h b/H/iatoms.h index aeefbb2d7..c835df88a 100644 --- a/H/iatoms.h +++ b/H/iatoms.h @@ -374,7 +374,7 @@ FunctorMultiFileClause = Yap_MkFunctor(AtomMfClause,5); FunctorMutable = Yap_MkFunctor(AtomMutableVariable,(sizeof(timed_var)/sizeof(CELL))); FunctorNotImplemented = Yap_MkFunctor(AtomNotImplemented,2); - FunctorNBQueue = Yap_MkFunctor(AtomQueue,5); + FunctorNBQueue = Yap_MkFunctor(AtomQueue,4); FunctorNot = Yap_MkFunctor(AtomNot,1); FunctorOr = Yap_MkFunctor(AtomSemic,2); FunctorPermissionError = Yap_MkFunctor(AtomPermissionError,3); diff --git a/misc/ATOMS b/misc/ATOMS index 3e5eb05d1..48a18259d 100644 --- a/misc/ATOMS +++ b/misc/ATOMS @@ -86,7 +86,7 @@ A DollarUndef F "$undef" A DomainError N "domain_error" A E N "e" A EOFBeforeEOT N "end_of_file_found_before_end_of_term" -A EQ N "=" + A EQ N "=" A EmptyAtom N "" A EndOfStream N "$end_of_stream" A Eof N "end_of_file" @@ -383,7 +383,7 @@ F Module Colomn 2 F MultiFileClause MfClause 5 F Mutable MutableVariable (sizeof(timed_var)/sizeof(CELL)) F NotImplemented NotImplemented 2 -F NBQueue Queue 5 +F NBQueue Queue 4 F Not Not 1 F Or Semic 2 F PermissionError PermissionError 3