fix bad initialization with tabling.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1439 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
bd9ed1e1e6
commit
3e0d7d8749
2
C/init.c
2
C/init.c
@ -1179,7 +1179,7 @@ Yap_InitWorkspace(int Heap, int Stack, int Trail, int max_table_size,
|
||||
#endif /* YAPOR */
|
||||
|
||||
#if defined(YAPOR) || defined(TABLING)
|
||||
init_global(max_table_size, n_workers, sch_loop, delay_load);
|
||||
Yap_init_global(max_table_size, n_workers, sch_loop, delay_load);
|
||||
#endif /* YAPOR || TABLING */
|
||||
|
||||
Yap_InitTime ();
|
||||
|
@ -111,6 +111,8 @@ CELL old_value = 0L, old_value2 = 0L;
|
||||
static void
|
||||
jmp_deb(int i) {if (i) printf("Here we go\n"); else jmp_deb(0);}
|
||||
|
||||
struct various_codes *sc;
|
||||
|
||||
void
|
||||
low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
|
||||
{
|
||||
@ -119,6 +121,7 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args)
|
||||
Int arity;
|
||||
/* extern int gc_calls; */
|
||||
|
||||
sc = Yap_heap_regs;
|
||||
vsc_count++;
|
||||
#ifdef COMMENTED
|
||||
// if (vsc_count == 218280)
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
Copyright: R. Rocha and NCC - University of Porto, Portugal
|
||||
File: opt.init.c
|
||||
version: $Id: opt.init.c,v 1.12 2005-08-10 21:36:34 ricroc Exp $
|
||||
version: $Id: opt.init.c,v 1.13 2005-11-04 01:17:17 vsc Exp $
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
@ -61,7 +61,7 @@ ma_h_inner_struct *Yap_ma_h_top;
|
||||
** Global functions **
|
||||
** -------------------------- */
|
||||
|
||||
void init_global(int max_table_size, int n_workers, int sch_loop, int delay_load) {
|
||||
void Yap_init_global(int max_table_size, int n_workers, int sch_loop, int delay_load) {
|
||||
int i;
|
||||
|
||||
/* global data related to memory management */
|
||||
@ -146,8 +146,11 @@ void init_global(int max_table_size, int n_workers, int sch_loop, int delay_load
|
||||
GLOBAL_last_sg_fr = NULL;
|
||||
GLOBAL_check_sg_fr = NULL;
|
||||
#endif /* LIMIT_TABLING */
|
||||
for (i = 0; i < MAX_TABLE_VARS; i++)
|
||||
GLOBAL_table_var_enumerator(i) = (CELL) & GLOBAL_table_var_enumerator(i);
|
||||
for (i = 0; i < MAX_TABLE_VARS; i++) {
|
||||
CELL *pt = ADDR_GLOBAL_table_var_enumerator(i);
|
||||
|
||||
RESET_VARIABLE(pt);
|
||||
}
|
||||
#ifdef TABLE_LOCK_AT_WRITE_LEVEL
|
||||
for (i = 0; i < TABLE_LOCK_BUCKETS; i++)
|
||||
INIT_LOCK(GLOBAL_table_lock(i));
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
Copyright: R. Rocha and NCC - University of Porto, Portugal
|
||||
File: opt.proto.h
|
||||
version: $Id: opt.proto.h,v 1.11 2005-08-04 15:45:55 ricroc Exp $
|
||||
version: $Id: opt.proto.h,v 1.12 2005-11-04 01:17:17 vsc Exp $
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
@ -41,7 +41,7 @@ void error_message(const char *mesg, ...);
|
||||
** opt.init.c **
|
||||
** ------------ */
|
||||
|
||||
void init_global(int max_table_size, int n_workers, int sch_loop, int delay_load);
|
||||
void Yap_init_global(int max_table_size, int n_workers, int sch_loop, int delay_load);
|
||||
void init_local(void);
|
||||
void make_root_frames(void);
|
||||
#ifdef YAPOR
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
Copyright: R. Rocha and NCC - University of Porto, Portugal
|
||||
File: opt.structs.h
|
||||
version: $Id: opt.structs.h,v 1.9 2005-08-04 15:45:55 ricroc Exp $
|
||||
version: $Id: opt.structs.h,v 1.10 2005-11-04 01:17:17 vsc Exp $
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
@ -236,11 +236,13 @@ struct global_data{
|
||||
#define GLOBAL_check_sg_fr (GLOBAL.check_subgoal_frame)
|
||||
#define GLOBAL_root_dep_fr (GLOBAL.root_dependency_frame)
|
||||
#define GLOBAL_table_var_enumerator(index) (GLOBAL.table_var_enumerator[index])
|
||||
#define ADDR_GLOBAL_table_var_enumerator(index) (GLOBAL.table_var_enumerator+(index))
|
||||
#define GLOBAL_table_lock(index) (GLOBAL.table_lock[index])
|
||||
#define GLOBAL_timestamp (GLOBAL.timestamp)
|
||||
|
||||
|
||||
|
||||
|
||||
/* ------------------------------ **
|
||||
** Struct local_signals **
|
||||
** ------------------------------ */
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
Copyright: R. Rocha and NCC - University of Porto, Portugal
|
||||
File: tab.tries.C
|
||||
version: $Id: tab.tries.c,v 1.16 2005-08-04 15:45:56 ricroc Exp $
|
||||
version: $Id: tab.tries.c,v 1.17 2005-11-04 01:17:17 vsc Exp $
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
@ -694,6 +694,8 @@ sg_fr_ptr subgoal_search(yamop *preg, CELL **Yaddr) {
|
||||
LOCK(TabEnt_lock(tab_ent));
|
||||
#endif /* TABLE_LOCK_LEVEL */
|
||||
for (i = 1; i <= arity; i++) {
|
||||
extern long long vsc_count;
|
||||
|
||||
STACK_PUSH_UP(XREGS[i], stack_terms);
|
||||
STACK_CHECK_EXPAND(stack_terms, stack_terms_limit, stack_terms_base);
|
||||
do {
|
||||
|
Reference in New Issue
Block a user