2001-04-09 20:54:03 +01:00
|
|
|
/*************************************************************************
|
|
|
|
* *
|
|
|
|
* YAP Prolog %W% %G% *
|
|
|
|
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
|
|
|
* *
|
|
|
|
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
|
|
|
* *
|
|
|
|
**************************************************************************
|
|
|
|
* *
|
|
|
|
* File: Heap.h *
|
|
|
|
* mods: *
|
|
|
|
* comments: Heap Init Structure *
|
2008-08-08 15:05:34 +01:00
|
|
|
* version: $Id: Heap.h,v 1.136 2008-08-08 14:05:34 vsc Exp $ *
|
2001-04-09 20:54:03 +01:00
|
|
|
*************************************************************************/
|
|
|
|
|
|
|
|
/* information that can be stored in Code Space */
|
|
|
|
|
2004-02-05 16:57:02 +00:00
|
|
|
#ifndef HEAP_H
|
|
|
|
#define HEAP_H 1
|
|
|
|
|
2006-04-28 16:48:33 +01:00
|
|
|
#if defined(YAPOR) || defined(THREADS)
|
|
|
|
#define WL wl[worker_id]
|
|
|
|
#else
|
|
|
|
#define WL wl
|
2008-03-25 16:45:53 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(THREADS)
|
|
|
|
#define RINFO rinfo[worker_id]
|
|
|
|
#else
|
2006-04-28 16:48:33 +01:00
|
|
|
#define RINFO rinfo
|
|
|
|
#endif
|
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
#ifndef INT_KEYS_DEFAULT_SIZE
|
|
|
|
#define INT_KEYS_DEFAULT_SIZE 256
|
|
|
|
#endif
|
|
|
|
|
2006-05-16 19:37:31 +01:00
|
|
|
#if USE_DL_MALLOC
|
|
|
|
|
|
|
|
#define MAX_DLMALLOC_HOLES 32
|
|
|
|
|
|
|
|
typedef struct memory_hole {
|
|
|
|
ADDR start;
|
|
|
|
ADDR end;
|
|
|
|
} memory_hole_type;
|
|
|
|
#endif
|
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2005-12-07 17:53:30 +00:00
|
|
|
#define GC_MAVARS_HASH_SIZE 512
|
|
|
|
|
|
|
|
typedef struct gc_ma_hash_entry_struct {
|
|
|
|
UInt timestmp;
|
2008-03-25 22:03:14 +00:00
|
|
|
#ifdef TABLING
|
2006-12-29 01:57:50 +00:00
|
|
|
tr_fr_ptr loc;
|
|
|
|
struct gc_ma_hash_entry_struct *more;
|
|
|
|
#endif
|
2005-12-07 17:53:30 +00:00
|
|
|
CELL* addr;
|
|
|
|
struct gc_ma_hash_entry_struct *next;
|
|
|
|
} gc_ma_hash_entry;
|
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
typedef struct atom_hash_entry {
|
|
|
|
#if defined(YAPOR) || defined(THREADS)
|
|
|
|
rwlock_t AERWLock;
|
|
|
|
#endif
|
|
|
|
Atom Entry;
|
|
|
|
} AtomHashEntry;
|
|
|
|
|
2002-09-03 15:28:09 +01:00
|
|
|
typedef struct reduction_counters {
|
2003-03-20 15:10:18 +00:00
|
|
|
YAP_ULONG_LONG reductions;
|
|
|
|
YAP_ULONG_LONG reductions_retries;
|
|
|
|
YAP_ULONG_LONG retries;
|
2002-09-03 15:28:09 +01:00
|
|
|
int reductions_on;
|
|
|
|
int reductions_retries_on;
|
|
|
|
int retries_on;
|
|
|
|
} red_counters;
|
|
|
|
|
2004-01-23 02:23:51 +00:00
|
|
|
typedef struct scratch_block_struct {
|
|
|
|
char *ptr;
|
|
|
|
UInt sz, msz;
|
|
|
|
} scratch_block;
|
|
|
|
|
2005-01-04 02:50:23 +00:00
|
|
|
typedef struct restore_info {
|
2009-03-16 17:30:13 +00:00
|
|
|
Int
|
|
|
|
base_diff,
|
|
|
|
cl_diff,
|
2005-01-04 02:50:23 +00:00
|
|
|
g_diff,
|
2006-08-22 17:12:46 +01:00
|
|
|
g_diff0,
|
2005-01-04 02:50:23 +00:00
|
|
|
h_diff,
|
|
|
|
l_diff,
|
|
|
|
tr_diff,
|
|
|
|
x_diff,
|
|
|
|
delay_diff;
|
|
|
|
CELL *old_ASP, *old_LCL0;
|
2006-08-22 17:12:46 +01:00
|
|
|
CELL *g_split;
|
2005-01-04 02:50:23 +00:00
|
|
|
tr_fr_ptr old_TR;
|
|
|
|
CELL *old_GlobalBase, *old_H, *old_H0;
|
2008-01-23 17:57:56 +00:00
|
|
|
CELL *old_DelayTop, *current_DelayTop;
|
2005-01-04 02:50:23 +00:00
|
|
|
ADDR old_TrailBase, old_TrailTop;
|
|
|
|
ADDR old_HeapBase, old_HeapTop;
|
|
|
|
} restoreinfo;
|
|
|
|
|
2008-03-25 16:45:53 +00:00
|
|
|
#if defined(THREADS)
|
2008-04-02 16:41:50 +01:00
|
|
|
extern struct restore_info rinfo[MAX_THREADS];
|
2005-01-04 02:50:23 +00:00
|
|
|
#else
|
|
|
|
extern struct restore_info rinfo;
|
|
|
|
#endif
|
|
|
|
|
2004-01-23 02:23:51 +00:00
|
|
|
typedef struct worker_local_struct {
|
2005-10-28 18:38:50 +01:00
|
|
|
struct format_status *f_info;
|
2009-02-26 23:06:27 +00:00
|
|
|
Int delay_arena_overflows;
|
2009-02-27 00:31:29 +00:00
|
|
|
Int arena_overflows;
|
|
|
|
Int depth_arenas;
|
2004-12-28 22:20:37 +00:00
|
|
|
char *scanner_stack;
|
|
|
|
struct scanner_extra_alloc *scanner_extra_blocks;
|
2004-02-11 13:33:19 +00:00
|
|
|
#if defined(YAPOR) || defined(THREADS)
|
2004-01-23 02:23:51 +00:00
|
|
|
lockvar signal_lock; /* protect signal handlers from IPIs */
|
2004-02-11 13:33:19 +00:00
|
|
|
struct pred_entry *wpp;
|
2006-01-02 02:16:19 +00:00
|
|
|
#endif
|
|
|
|
#ifdef USE_GMP
|
|
|
|
mpz_t big_tmp;
|
2004-01-23 02:23:51 +00:00
|
|
|
#endif
|
2006-04-28 16:48:33 +01:00
|
|
|
union CONSULT_OBJ *consultsp;
|
|
|
|
union CONSULT_OBJ *consultbase;
|
|
|
|
union CONSULT_OBJ *consultlow;
|
2009-02-10 23:42:26 +00:00
|
|
|
struct pred_entry *last_asserted_pred;
|
2008-09-02 03:48:02 +01:00
|
|
|
int debug_on;
|
2006-04-28 16:48:33 +01:00
|
|
|
UInt consultcapacity;
|
2004-01-23 02:23:51 +00:00
|
|
|
UInt active_signals;
|
|
|
|
UInt i_pred_arity;
|
|
|
|
yamop *prof_end;
|
|
|
|
Int start_line;
|
2004-11-19 21:32:53 +00:00
|
|
|
int uncaught_throw;
|
2004-12-08 04:45:04 +00:00
|
|
|
int doing_undefp;
|
2004-01-23 02:23:51 +00:00
|
|
|
scratch_block scratchpad;
|
|
|
|
#ifdef MULTI_ASSIGNMENT_VARIABLES
|
|
|
|
Term woken_goals;
|
|
|
|
Term atts_mutable_list;
|
|
|
|
#endif
|
2004-10-06 17:55:48 +01:00
|
|
|
/* gc_stuff */
|
2005-09-21 04:49:33 +01:00
|
|
|
Term gc_generation; /* global stack limit at last generation */
|
2006-03-06 14:04:57 +00:00
|
|
|
Term gc_phase; /* gc phase to be sure we are on a valid compression */
|
|
|
|
UInt gc_current_phase; /* gc currrent phase */
|
2004-10-06 17:55:48 +01:00
|
|
|
unsigned int gc_calls; /* number of times GC has been called */
|
|
|
|
Int tot_gc_time; /* total time spent in GC */
|
2005-12-05 17:16:12 +00:00
|
|
|
YAP_ULONG_LONG tot_gc_recovered; /* number of heap objects in all garbage collections */
|
2008-01-23 17:57:56 +00:00
|
|
|
Int last_gc_time, last_ss_time; /* number of heap objects in all garbage collections */
|
2005-12-05 17:16:12 +00:00
|
|
|
/* in a single gc */
|
|
|
|
#if defined(YAPOR) || defined(THREADS)
|
|
|
|
/* otherwise, use global variables for speed */
|
|
|
|
unsigned long int tot_marked, tot_oldies; /* number of heap objects marked */
|
|
|
|
#ifdef COROUTINING
|
|
|
|
unsigned long int tot_smarked;
|
|
|
|
#endif
|
|
|
|
struct choicept *wl_current_B;
|
2005-12-07 17:53:30 +00:00
|
|
|
#if defined(TABLING) || defined(SBA)
|
2005-12-05 17:16:12 +00:00
|
|
|
struct trail_frame *wl_sTR, *wl_sTR0;
|
2005-12-07 17:53:30 +00:00
|
|
|
struct trail_frame *new_tr;
|
|
|
|
#else
|
|
|
|
Term *wl_sTR, *wl_sTR0;
|
|
|
|
Term *new_tr;
|
2005-12-05 17:16:12 +00:00
|
|
|
#endif
|
2005-12-07 17:53:30 +00:00
|
|
|
CELL *wl_prev_HB;
|
|
|
|
CELL *hgen;
|
|
|
|
CELL **ip_top;
|
|
|
|
#if GC_NO_TAGS
|
|
|
|
char *b_p;
|
|
|
|
#endif
|
|
|
|
struct gc_mark_continuation *conttop0;
|
|
|
|
struct gc_mark_continuation *conttop;
|
|
|
|
int disc_trail_entries;
|
|
|
|
gc_ma_hash_entry Gc_ma_hash_table[GC_MAVARS_HASH_SIZE];
|
|
|
|
gc_ma_hash_entry *Gc_ma_h_top;
|
2006-12-29 01:57:50 +00:00
|
|
|
gc_ma_hash_entry *Gc_ma_h_list;
|
2005-12-07 17:53:30 +00:00
|
|
|
UInt Gc_timestamp; /* an unsigned int */
|
|
|
|
ADDR DB_vec, DB_vec0;
|
|
|
|
struct RB_red_blk_node *DB_root, *DB_nil;
|
|
|
|
#endif /* defined(YAPOR) || defined(THREADS) */
|
2004-10-27 16:56:34 +01:00
|
|
|
jmp_buf gc_restore; /* where to jump if garbage collection crashes */
|
2005-10-28 18:38:50 +01:00
|
|
|
struct array_entry *dynamic_arrays;
|
|
|
|
struct static_array_entry *static_arrays;
|
2006-08-22 17:12:46 +01:00
|
|
|
struct global_entry *global_variables;
|
2007-03-22 11:12:22 +00:00
|
|
|
int allow_restart;
|
2006-08-22 17:12:46 +01:00
|
|
|
Term global_arena;
|
2007-09-17 23:17:49 +01:00
|
|
|
UInt global_arena_overflows;
|
2006-08-22 17:12:46 +01:00
|
|
|
Term global_delay_arena;
|
2004-11-04 18:22:36 +00:00
|
|
|
yamop trust_lu_code[3];
|
2004-01-23 02:23:51 +00:00
|
|
|
} worker_local;
|
|
|
|
|
|
|
|
#ifdef THREADS
|
|
|
|
typedef struct thandle {
|
|
|
|
int in_use;
|
2008-01-27 11:01:07 +00:00
|
|
|
int zombie;
|
2004-01-23 02:23:51 +00:00
|
|
|
UInt ssize;
|
|
|
|
UInt tsize;
|
2008-08-07 21:51:23 +01:00
|
|
|
UInt sysize;
|
2008-04-02 18:37:07 +01:00
|
|
|
void *stack_address;
|
2004-02-11 01:20:56 +00:00
|
|
|
Term tdetach;
|
2008-08-07 21:51:23 +01:00
|
|
|
Term cmod, texit_mod;
|
|
|
|
struct DB_TERM *tgoal, *texit;
|
2004-01-23 02:23:51 +00:00
|
|
|
int id;
|
|
|
|
int ret;
|
|
|
|
REGSTORE *default_yaam_regs;
|
2004-02-05 16:57:02 +00:00
|
|
|
REGSTORE *current_yaam_regs;
|
|
|
|
struct pred_entry *local_preds;
|
2004-01-23 02:23:51 +00:00
|
|
|
pthread_t handle;
|
2004-07-22 22:32:23 +01:00
|
|
|
int ref_count;
|
2008-05-11 00:24:13 +01:00
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
long long int thread_inst_count;
|
2008-05-28 18:18:35 +01:00
|
|
|
int been_here1;
|
|
|
|
int been_here2;
|
2008-05-11 00:24:13 +01:00
|
|
|
#endif
|
2004-02-11 13:59:53 +00:00
|
|
|
pthread_mutex_t tlock;
|
2008-08-06 18:32:22 +01:00
|
|
|
pthread_mutex_t tlock_status;
|
2004-03-02 16:44:58 +00:00
|
|
|
#if HAVE_GETRUSAGE
|
|
|
|
struct timeval *start_of_timesp;
|
|
|
|
struct timeval *last_timep;
|
|
|
|
#endif
|
2004-01-23 02:23:51 +00:00
|
|
|
} yap_thandle;
|
|
|
|
#endif
|
|
|
|
|
2002-06-04 19:21:55 +01:00
|
|
|
typedef int (*Agc_hook)(Atom);
|
|
|
|
|
2001-04-09 20:54:03 +01:00
|
|
|
typedef struct various_codes {
|
|
|
|
special_functors funcs;
|
2006-05-19 15:31:32 +01:00
|
|
|
UInt hole_size;
|
2004-10-28 21:12:23 +01:00
|
|
|
struct malloc_state *av_;
|
2006-11-06 18:35:05 +00:00
|
|
|
|
2009-04-08 00:32:36 +01:00
|
|
|
yap_exec_mode execution_mode;
|
2009-03-27 15:15:54 +00:00
|
|
|
UInt atts_size;
|
2006-11-06 18:35:05 +00:00
|
|
|
UInt clause_space, index_space_Tree, index_space_EXT, index_space_SW;
|
|
|
|
UInt lu_clause_space, lu_index_space_Tree, lu_index_space_CP, lu_index_space_EXT, lu_index_space_SW;
|
2006-05-16 19:37:31 +01:00
|
|
|
#if USE_DL_MALLOC
|
|
|
|
struct memory_hole memory_holes[MAX_DLMALLOC_HOLES];
|
|
|
|
UInt nof_memory_holes;
|
|
|
|
#endif
|
2001-04-09 20:54:03 +01:00
|
|
|
Int heap_used;
|
|
|
|
Int heap_max;
|
|
|
|
ADDR heap_top;
|
2004-01-23 02:23:51 +00:00
|
|
|
ADDR heap_lim;
|
2001-06-08 14:38:42 +01:00
|
|
|
struct FREEB *free_blocks;
|
2001-04-09 20:54:03 +01:00
|
|
|
#if defined(YAPOR) || defined(THREADS)
|
2004-02-05 16:57:02 +00:00
|
|
|
lockvar bgl; /* protect long critical regions */
|
2001-04-09 20:54:03 +01:00
|
|
|
lockvar free_blocks_lock; /* protect the list of free blocks */
|
2008-04-02 16:41:50 +01:00
|
|
|
worker_local wl[MAX_AGENTS];
|
2004-01-23 02:23:51 +00:00
|
|
|
#else
|
|
|
|
worker_local wl;
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif
|
2006-04-27 15:13:24 +01:00
|
|
|
#ifdef BEAM
|
|
|
|
yamop beam_retry_code;
|
|
|
|
#endif /* BEAM */
|
2001-04-09 20:54:03 +01:00
|
|
|
#ifdef YAPOR
|
2005-07-06 20:34:12 +01:00
|
|
|
int seq_def;
|
|
|
|
yamop getwork_code;
|
|
|
|
yamop getwork_seq_code;
|
|
|
|
yamop getwork_first_time_code;
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif /* YAPOR */
|
|
|
|
#ifdef TABLING
|
2005-08-01 16:40:39 +01:00
|
|
|
yamop table_load_answer_code;
|
|
|
|
yamop table_try_answer_code;
|
2005-07-06 20:34:12 +01:00
|
|
|
yamop table_answer_resolution_code;
|
|
|
|
yamop table_completion_code;
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif /* TABLING */
|
2008-09-01 16:48:05 +01:00
|
|
|
OPCODE execute_cpred_op_code, expand_op_code;
|
2004-09-27 21:45:04 +01:00
|
|
|
yamop *expand_clauses_first, *expand_clauses_last;
|
2008-01-23 17:57:56 +00:00
|
|
|
UInt expand_clauses;
|
2004-09-27 21:45:04 +01:00
|
|
|
#if defined(YAPOR) || defined(THREADS)
|
|
|
|
lockvar expand_clauses_list_lock;
|
2006-04-28 14:23:23 +01:00
|
|
|
lockvar op_list_lock;
|
2004-09-27 21:45:04 +01:00
|
|
|
#endif
|
2003-01-29 14:47:17 +00:00
|
|
|
yamop comma_code[5];
|
2003-04-30 18:46:05 +01:00
|
|
|
yamop failcode[1];
|
2001-06-22 18:53:36 +01:00
|
|
|
OPCODE failcode_1;
|
|
|
|
OPCODE failcode_2;
|
|
|
|
OPCODE failcode_3;
|
|
|
|
OPCODE failcode_4;
|
|
|
|
OPCODE failcode_5;
|
|
|
|
OPCODE failcode_6;
|
2002-02-26 15:51:54 +00:00
|
|
|
struct {
|
|
|
|
OPCODE op;
|
|
|
|
#ifdef YAPOR
|
|
|
|
COUNT ltt;
|
|
|
|
COUNT cut;
|
|
|
|
COUNT seq;
|
|
|
|
#endif /* YAPOR */
|
|
|
|
COUNT s;
|
|
|
|
CELL *l2;
|
|
|
|
struct pred_entry *p;
|
|
|
|
struct pred_entry *p0;
|
|
|
|
} env_for_trustfail_code; /* sla */
|
2003-04-30 18:46:05 +01:00
|
|
|
yamop trustfailcode[1];
|
2001-04-09 20:54:03 +01:00
|
|
|
struct {
|
|
|
|
OPCODE op;
|
|
|
|
#ifdef YAPOR
|
|
|
|
COUNT ltt;
|
|
|
|
COUNT cut;
|
|
|
|
COUNT seq;
|
|
|
|
#endif /* YAPOR */
|
|
|
|
COUNT s;
|
2002-02-26 15:51:54 +00:00
|
|
|
CELL *l2;
|
|
|
|
struct pred_entry *p;
|
|
|
|
struct pred_entry *p0;
|
2001-04-09 20:54:03 +01:00
|
|
|
} env_for_yes_code; /* sla */
|
2008-03-25 16:45:53 +00:00
|
|
|
struct yami yescode;
|
|
|
|
struct yami nocode;
|
|
|
|
struct yami rtrycode;
|
2001-04-09 20:54:03 +01:00
|
|
|
struct {
|
|
|
|
OPREG arity;
|
2002-12-27 16:53:09 +00:00
|
|
|
struct yami *clause;
|
2001-04-09 20:54:03 +01:00
|
|
|
Functor func;
|
2003-04-30 18:46:05 +01:00
|
|
|
} clausecode[1];
|
2001-06-11 18:40:16 +01:00
|
|
|
#if HAVE_LIBREADLINE
|
|
|
|
char *readline_buf, *readline_pos;
|
|
|
|
#endif
|
2001-04-09 20:54:03 +01:00
|
|
|
#if USE_THREADED_CODE
|
|
|
|
opentry *op_rtable;
|
|
|
|
#endif
|
2009-02-12 16:39:20 +00:00
|
|
|
struct udi_info *udi_control_blocks;
|
2001-04-09 20:54:03 +01:00
|
|
|
#ifdef COROUTINING
|
|
|
|
int num_of_atts; /* max. number of attributes we have for a variable */
|
2002-09-23 18:06:13 +01:00
|
|
|
struct pred_entry *wake_up_code;
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif
|
2001-10-30 16:42:05 +00:00
|
|
|
struct pred_entry *creep_code;
|
|
|
|
struct pred_entry *undef_code;
|
|
|
|
struct pred_entry *spy_code;
|
2006-10-11 15:53:57 +01:00
|
|
|
UInt new_cps, live_cps, dirty_cps, freed_cps;
|
2002-11-11 17:38:10 +00:00
|
|
|
int system_profiling;
|
|
|
|
int system_call_counting;
|
2004-12-05 05:01:45 +00:00
|
|
|
int system_pred_goal_expansion_all;
|
|
|
|
int system_pred_goal_expansion_func;
|
2003-01-29 14:47:17 +00:00
|
|
|
int system_pred_goal_expansion_on;
|
2002-11-11 17:38:10 +00:00
|
|
|
int compiler_optimizer_on;
|
|
|
|
int compiler_compile_mode;
|
2001-04-09 20:54:03 +01:00
|
|
|
AtomHashEntry invisiblechain;
|
2003-04-30 18:46:05 +01:00
|
|
|
OPCODE dummycode[1];
|
2005-12-05 17:16:12 +00:00
|
|
|
UInt maxdepth, maxlist, maxwriteargs;
|
2001-04-09 20:54:03 +01:00
|
|
|
int update_mode;
|
|
|
|
Atom atprompt;
|
|
|
|
char prompt[MAX_PROMPT];
|
|
|
|
OPCODE undef_op;
|
|
|
|
OPCODE index_op;
|
2007-11-26 23:43:10 +00:00
|
|
|
OPCODE lockpred_op;
|
2002-10-14 17:25:38 +01:00
|
|
|
OPCODE fail_op;
|
2003-08-27 14:37:10 +01:00
|
|
|
yamop *retry_recorded_k_code,
|
2001-04-09 20:54:03 +01:00
|
|
|
*retry_c_recordedp_code;
|
|
|
|
Int static_predicates_marked;
|
|
|
|
UInt int_keys_size;
|
|
|
|
UInt int_keys_timestamp;
|
|
|
|
Prop *IntKeys;
|
2003-08-27 14:37:10 +01:00
|
|
|
UInt int_lu_keys_size;
|
|
|
|
UInt int_lu_keys_timestamp;
|
|
|
|
Prop *IntLUKeys;
|
2001-04-09 20:54:03 +01:00
|
|
|
UInt int_bb_keys_size;
|
|
|
|
Prop *IntBBKeys;
|
|
|
|
Int yap_flags_field[NUMBER_OF_YAP_FLAGS];
|
|
|
|
char *char_conversion_table;
|
|
|
|
char *char_conversion_table2;
|
2008-03-25 16:45:53 +00:00
|
|
|
#if defined(THREADS) || defined(YAPOR)
|
2004-03-02 16:44:58 +00:00
|
|
|
unsigned int n_of_threads; /* number of threads and processes in system */
|
|
|
|
unsigned int n_of_threads_created; /* number of threads created since start */
|
|
|
|
UInt threads_total_time; /* total run time for dead threads */
|
|
|
|
#endif
|
2001-04-09 20:54:03 +01:00
|
|
|
#if defined(YAPOR) || defined(THREADS)
|
2002-10-21 23:52:36 +01:00
|
|
|
lockvar heap_used_lock; /* protect HeapUsed */
|
2001-04-09 20:54:03 +01:00
|
|
|
lockvar heap_top_lock; /* protect HeapTop */
|
2006-03-22 20:07:28 +00:00
|
|
|
lockvar dead_static_clauses_lock; /* protect DeadStaticClauses */
|
|
|
|
lockvar dead_mega_clauses_lock; /* protect DeadMegaClauses */
|
|
|
|
lockvar dead_static_indices_lock; /* protect DeadStaticIndices */
|
2007-11-06 17:02:13 +00:00
|
|
|
lockvar dbterms_list_lock; /* protect DBTermList */
|
2001-04-09 20:54:03 +01:00
|
|
|
int heap_top_owner;
|
2004-02-16 19:22:40 +00:00
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
lockvar low_level_trace_lock;
|
|
|
|
#endif
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif
|
|
|
|
unsigned int size_of_overflow;
|
2007-04-10 23:13:21 +01:00
|
|
|
struct mod_entry *current_modules;
|
2006-04-28 14:23:23 +01:00
|
|
|
struct operator_entry *op_list;
|
2007-12-05 12:17:25 +00:00
|
|
|
struct hold_entry *global_hold_entry;
|
2006-03-22 20:07:28 +00:00
|
|
|
struct static_clause *dead_static_clauses;
|
|
|
|
struct static_mega_clause *dead_mega_clauses;
|
|
|
|
struct static_index *dead_static_indices;
|
2007-11-06 17:02:13 +00:00
|
|
|
struct dbterm_list *dbterms_list;
|
2008-12-23 01:53:52 +00:00
|
|
|
#include "tatoms.h"
|
2001-04-09 20:54:03 +01:00
|
|
|
Term
|
|
|
|
#ifdef EUROTRA
|
|
|
|
term_dollar_u,
|
|
|
|
#endif
|
2001-10-30 16:42:05 +00:00
|
|
|
term_prolog,
|
2004-02-12 12:37:12 +00:00
|
|
|
term_refound_var,
|
|
|
|
user_module,
|
|
|
|
idb_module,
|
|
|
|
attributes_module,
|
|
|
|
charsio_module,
|
2006-05-17 19:38:11 +01:00
|
|
|
terms_module,
|
2006-08-02 19:18:31 +01:00
|
|
|
system_module,
|
2006-08-25 20:50:35 +01:00
|
|
|
readutil_module,
|
2006-12-27 01:32:38 +00:00
|
|
|
hacks_module,
|
2008-02-12 17:03:59 +00:00
|
|
|
arg_module,
|
2007-10-10 10:44:28 +01:00
|
|
|
globals_module,
|
|
|
|
swi_module;
|
2001-04-09 20:54:03 +01:00
|
|
|
void *last_wtime;
|
2002-09-23 18:06:13 +01:00
|
|
|
struct pred_entry *pred_goal_expansion;
|
|
|
|
struct pred_entry *pred_meta_call;
|
|
|
|
struct pred_entry *pred_dollar_catch;
|
2003-08-27 14:37:10 +01:00
|
|
|
struct pred_entry *pred_recorded_with_key;
|
|
|
|
struct pred_entry *pred_log_upd_clause;
|
2008-01-23 17:57:56 +00:00
|
|
|
struct pred_entry *pred_log_upd_clause_erase;
|
2003-08-27 14:37:10 +01:00
|
|
|
struct pred_entry *pred_log_upd_clause0;
|
2003-11-21 16:56:20 +00:00
|
|
|
struct pred_entry *pred_static_clause;
|
2002-09-23 18:06:13 +01:00
|
|
|
struct pred_entry *pred_throw;
|
|
|
|
struct pred_entry *pred_handle_throw;
|
2009-02-09 21:56:40 +00:00
|
|
|
struct pred_entry *pred_is;
|
2002-06-04 01:46:32 +01:00
|
|
|
struct DB_STRUCT *db_erased_marker;
|
2006-02-24 14:03:42 +00:00
|
|
|
struct logic_upd_clause *logdb_erased_marker;
|
2003-11-12 12:33:31 +00:00
|
|
|
struct logic_upd_clause *db_erased_list;
|
|
|
|
struct logic_upd_index *db_erased_ilist;
|
2004-09-03 04:11:09 +01:00
|
|
|
UInt expand_clauses_sz;
|
2002-11-11 17:38:10 +00:00
|
|
|
struct stream_desc *yap_streams;
|
|
|
|
int debugger_output_msg;
|
2001-04-16 17:41:04 +01:00
|
|
|
UInt n_of_file_aliases;
|
|
|
|
UInt sz_of_file_aliases;
|
2001-06-08 14:38:42 +01:00
|
|
|
struct AliasDescS * file_aliases;
|
2003-05-20 20:11:59 +01:00
|
|
|
#if LOW_PROF
|
|
|
|
int profiler_on;
|
2005-12-17 03:25:39 +00:00
|
|
|
int offline_profiler;
|
2005-05-26 19:03:08 +01:00
|
|
|
FILE *f_prof, *f_preds;
|
2003-05-20 20:11:59 +01:00
|
|
|
UInt prof_preds;
|
|
|
|
#endif /* LOW_PROF */
|
2002-09-03 15:28:09 +01:00
|
|
|
struct reduction_counters call_counters;
|
2001-04-09 20:54:03 +01:00
|
|
|
char *yap_lib_dir;
|
2007-02-18 00:26:36 +00:00
|
|
|
UInt agc_last_call; /* amount of space recovered in all garbage collections */
|
|
|
|
UInt agc_threshold; /* amount of space recovered in all garbage collections */
|
2002-06-04 19:21:55 +01:00
|
|
|
Agc_hook agc_hook;
|
2002-11-11 17:38:10 +00:00
|
|
|
void *foreign_code_loaded;
|
|
|
|
ADDR foreign_code_base;
|
|
|
|
ADDR foreign_code_top;
|
|
|
|
ADDR foreign_code_max;
|
2007-09-29 00:18:17 +01:00
|
|
|
struct pred_entry **pred_hash;
|
|
|
|
#if defined(YAPOR) || defined(THREADS)
|
|
|
|
rwlock_t pred_hash_rw_lock;
|
|
|
|
#endif
|
|
|
|
UInt preds_in_hash_table, pred_hash_table_size;
|
2002-06-05 02:34:06 +01:00
|
|
|
int parser_error_style;
|
2002-11-11 17:38:10 +00:00
|
|
|
int compiler_profiling;
|
|
|
|
int compiler_call_counting;
|
|
|
|
/********* whether we should try to compile array references ******************/
|
|
|
|
int compiler_compile_arrays;
|
|
|
|
/*
|
|
|
|
PREG just before we enter $spy. We use that to find out the clause which
|
|
|
|
was calling the debugged goal.
|
|
|
|
*/
|
|
|
|
yamop *debugger_p_before_spy;
|
2001-04-09 20:54:03 +01:00
|
|
|
#if defined(YAPOR) || defined(TABLING)
|
|
|
|
struct global_data global;
|
|
|
|
struct local_data remote[MAX_WORKERS];
|
2003-11-05 18:55:03 +00:00
|
|
|
#endif /* YAPOR || TABLING */
|
2004-01-23 02:23:51 +00:00
|
|
|
#ifdef THREADS
|
|
|
|
lockvar thread_handles_lock; /* protect ThreadManipulation */
|
2008-04-02 16:41:50 +01:00
|
|
|
struct thandle thread_handle[MAX_THREADS];
|
2004-01-23 02:23:51 +00:00
|
|
|
#endif
|
2003-10-28 01:16:03 +00:00
|
|
|
UInt n_of_atoms;
|
|
|
|
UInt atom_hash_table_size;
|
2006-11-27 17:42:03 +00:00
|
|
|
UInt wide_atom_hash_table_size;
|
|
|
|
UInt n_of_wide_atoms;
|
|
|
|
AtomHashEntry *wide_hash_chain;
|
2003-10-28 01:16:03 +00:00
|
|
|
AtomHashEntry *hash_chain;
|
2001-04-09 20:54:03 +01:00
|
|
|
} all_heap_codes;
|
|
|
|
|
2004-04-22 21:07:07 +01:00
|
|
|
#ifdef USE_SYSTEM_MALLOC
|
2008-08-08 15:05:34 +01:00
|
|
|
extern struct various_codes *Yap_heap_regs;
|
2004-01-23 02:23:51 +00:00
|
|
|
#else
|
2004-12-02 06:06:47 +00:00
|
|
|
#define Yap_heap_regs ((all_heap_codes *)HEAP_INIT_BASE)
|
2004-01-23 02:23:51 +00:00
|
|
|
#endif
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2006-05-19 15:31:32 +01:00
|
|
|
#define Yap_HoleSize Yap_heap_regs->hole_size
|
2004-12-02 06:06:47 +00:00
|
|
|
#define Yap_av Yap_heap_regs->av_
|
2009-04-08 00:32:36 +01:00
|
|
|
#define Yap_ExecutionMode Yap_heap_regs->execution_mode
|
2009-03-27 15:15:54 +00:00
|
|
|
#define Yap_AttsSize Yap_heap_regs->atts_size
|
2006-11-06 18:35:05 +00:00
|
|
|
#define Yap_ClauseSpace Yap_heap_regs->clause_space
|
|
|
|
#define Yap_IndexSpace_Tree Yap_heap_regs->index_space_Tree
|
|
|
|
#define Yap_IndexSpace_EXT Yap_heap_regs->index_space_EXT
|
|
|
|
#define Yap_IndexSpace_SW Yap_heap_regs->index_space_SW
|
|
|
|
#define Yap_LUClauseSpace Yap_heap_regs->lu_clause_space
|
|
|
|
#define Yap_LUIndexSpace_Tree Yap_heap_regs->lu_index_space_Tree
|
|
|
|
#define Yap_LUIndexSpace_CP Yap_heap_regs->lu_index_space_CP
|
|
|
|
#define Yap_LUIndexSpace_EXT Yap_heap_regs->lu_index_space_EXT
|
|
|
|
#define Yap_LUIndexSpace_SW Yap_heap_regs->lu_index_space_SW
|
2006-05-16 19:37:31 +01:00
|
|
|
#define Yap_MemoryHoles Yap_heap_regs->memory_holes
|
|
|
|
#define Yap_NOfMemoryHoles Yap_heap_regs->nof_memory_holes
|
2006-05-18 17:33:05 +01:00
|
|
|
#if USE_DL_MALLOC || (USE_SYSTEM_MALLOC && HAVE_MALLINFO)
|
|
|
|
#define HeapUsed Yap_givemallinfo()
|
2008-03-25 16:45:53 +00:00
|
|
|
#ifdef YAPOR
|
|
|
|
#define HeapUsedLock Yap_heap_regs->heap_used_lock
|
|
|
|
#endif
|
2006-05-18 17:33:05 +01:00
|
|
|
#else
|
2004-12-02 06:06:47 +00:00
|
|
|
#define HeapUsed Yap_heap_regs->heap_used
|
2006-05-18 17:33:05 +01:00
|
|
|
#define HeapUsedLock Yap_heap_regs->heap_used_lock
|
|
|
|
#endif
|
2004-12-02 06:06:47 +00:00
|
|
|
#define HeapMax Yap_heap_regs->heap_max
|
|
|
|
#define HeapTop Yap_heap_regs->heap_top
|
|
|
|
#define HeapLim Yap_heap_regs->heap_lim
|
2001-04-09 20:54:03 +01:00
|
|
|
#ifdef YAPOR
|
2004-12-02 06:06:47 +00:00
|
|
|
#define SEQUENTIAL_IS_DEFAULT Yap_heap_regs->seq_def
|
2005-07-06 20:34:12 +01:00
|
|
|
#define GETWORK (&(Yap_heap_regs->getwork_code))
|
|
|
|
#define GETWORK_SEQ (&(Yap_heap_regs->getwork_seq_code))
|
|
|
|
#define GETWORK_FIRST_TIME (&(Yap_heap_regs->getwork_first_time_code))
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif /* YAPOR */
|
2006-04-27 15:13:24 +01:00
|
|
|
#ifdef BEAM
|
|
|
|
#define BEAM_RETRY_CODE ((yamop *)&(Yap_heap_regs->beam_retry_code))
|
|
|
|
#endif /* BEAM */
|
2001-04-09 20:54:03 +01:00
|
|
|
#ifdef TABLING
|
2005-08-01 16:40:39 +01:00
|
|
|
#define LOAD_ANSWER ((yamop *)&(Yap_heap_regs->table_load_answer_code))
|
|
|
|
#define TRY_ANSWER ((yamop *)&(Yap_heap_regs->table_try_answer_code))
|
2005-07-06 20:34:12 +01:00
|
|
|
#define ANSWER_RESOLUTION ((yamop *)&(Yap_heap_regs->table_answer_resolution_code))
|
|
|
|
#define COMPLETION ((yamop *)&(Yap_heap_regs->table_completion_code))
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif /* TABLING */
|
2008-09-01 16:48:05 +01:00
|
|
|
#define EXECUTE_CPRED_OP_CODE Yap_heap_regs->execute_cpred_op_code
|
2004-12-02 06:06:47 +00:00
|
|
|
#define EXPAND_OP_CODE Yap_heap_regs->expand_op_code
|
|
|
|
#define ExpandClausesFirst Yap_heap_regs->expand_clauses_first
|
|
|
|
#define ExpandClausesLast Yap_heap_regs->expand_clauses_last
|
|
|
|
#define ExpandClausesListLock Yap_heap_regs->expand_clauses_list_lock
|
2008-01-23 17:57:56 +00:00
|
|
|
#define Yap_ExpandClauses Yap_heap_regs->expand_clauses
|
2006-04-28 14:23:23 +01:00
|
|
|
#define OpListLock Yap_heap_regs->op_list_lock
|
2004-12-02 06:06:47 +00:00
|
|
|
#define COMMA_CODE Yap_heap_regs->comma_code
|
|
|
|
#define FAILCODE Yap_heap_regs->failcode
|
|
|
|
#define TRUSTFAILCODE Yap_heap_regs->trustfailcode
|
2008-03-25 16:45:53 +00:00
|
|
|
#define YESCODE (&Yap_heap_regs->yescode)
|
|
|
|
#define NOCODE (&Yap_heap_regs->nocode)
|
|
|
|
#define RTRYCODE (&Yap_heap_regs->rtrycode)
|
2004-12-02 06:06:47 +00:00
|
|
|
#define DUMMYCODE Yap_heap_regs->dummycode
|
|
|
|
#define CLAUSECODE Yap_heap_regs->clausecode
|
|
|
|
#define INVISIBLECHAIN Yap_heap_regs->invisiblechain
|
|
|
|
#define max_depth Yap_heap_regs->maxdepth
|
|
|
|
#define max_list Yap_heap_regs->maxlist
|
2005-12-05 17:16:12 +00:00
|
|
|
#define max_write_args Yap_heap_regs->maxwriteargs
|
2004-12-02 06:06:47 +00:00
|
|
|
#define AtPrompt (&(Yap_heap_regs->atprompt ))
|
|
|
|
#define Prompt Yap_heap_regs->prompt
|
2001-04-09 20:54:03 +01:00
|
|
|
#if USE_THREADED_CODE
|
2004-12-02 06:06:47 +00:00
|
|
|
#define OP_RTABLE Yap_heap_regs->op_rtable
|
|
|
|
#endif
|
2009-02-12 16:39:20 +00:00
|
|
|
#define UdiControlBlocks Yap_heap_regs->udi_control_blocks
|
2004-12-02 06:06:47 +00:00
|
|
|
#define PROFILING Yap_heap_regs->system_profiling
|
|
|
|
#define CALL_COUNTING Yap_heap_regs->system_call_counting
|
2004-12-05 05:01:45 +00:00
|
|
|
#define PRED_GOAL_EXPANSION_ALL Yap_heap_regs->system_pred_goal_expansion_all
|
|
|
|
#define PRED_GOAL_EXPANSION_FUNC Yap_heap_regs->system_pred_goal_expansion_func
|
2004-12-02 06:06:47 +00:00
|
|
|
#define PRED_GOAL_EXPANSION_ON Yap_heap_regs->system_pred_goal_expansion_on
|
|
|
|
#define UPDATE_MODE Yap_heap_regs->update_mode
|
|
|
|
#define RETRY_C_RECORDED_CODE Yap_heap_regs->retry_recorded_code
|
|
|
|
#define RETRY_C_RECORDED_K_CODE Yap_heap_regs->retry_recorded_k_code
|
|
|
|
#define RETRY_C_RECORDEDP_CODE Yap_heap_regs->retry_c_recordedp_code
|
|
|
|
#define STATIC_PREDICATES_MARKED Yap_heap_regs->static_predicates_marked
|
|
|
|
#define yap_flags Yap_heap_regs->yap_flags_field
|
|
|
|
#define UNDEF_OPCODE Yap_heap_regs->undef_op
|
|
|
|
#define INDEX_OPCODE Yap_heap_regs->index_op
|
2007-11-26 23:43:10 +00:00
|
|
|
#define LOCKPRED_OPCODE Yap_heap_regs->lockpred_op
|
2004-12-02 06:06:47 +00:00
|
|
|
#define FAIL_OPCODE Yap_heap_regs->fail_op
|
2004-01-23 02:23:51 +00:00
|
|
|
#ifdef THREADS
|
2004-12-02 06:06:47 +00:00
|
|
|
#define ThreadHandlesLock Yap_heap_regs->thread_handles_lock
|
|
|
|
#define ThreadHandle Yap_heap_regs->thread_handle
|
|
|
|
#endif
|
|
|
|
#define NOfAtoms Yap_heap_regs->n_of_atoms
|
|
|
|
#define AtomHashTableSize Yap_heap_regs->atom_hash_table_size
|
|
|
|
#define HashChain Yap_heap_regs->hash_chain
|
2006-11-27 17:42:03 +00:00
|
|
|
#define NOfWideAtoms Yap_heap_regs->n_of_wide_atoms
|
|
|
|
#define WideAtomHashTableSize Yap_heap_regs->wide_atom_hash_table_size
|
|
|
|
#define WideHashChain Yap_heap_regs->wide_hash_chain
|
2004-12-02 06:06:47 +00:00
|
|
|
#define INT_KEYS_SIZE Yap_heap_regs->int_keys_size
|
|
|
|
#define INT_KEYS_TIMESTAMP Yap_heap_regs->int_keys_timestamp
|
|
|
|
#define INT_KEYS Yap_heap_regs->IntKeys
|
|
|
|
#define INT_LU_KEYS_SIZE Yap_heap_regs->int_lu_keys_size
|
|
|
|
#define INT_LU_KEYS_TIMESTAMP Yap_heap_regs->int_lu_keys_timestamp
|
|
|
|
#define INT_LU_KEYS Yap_heap_regs->IntLUKeys
|
|
|
|
#define INT_BB_KEYS_SIZE Yap_heap_regs->int_bb_keys_size
|
|
|
|
#define INT_BB_KEYS Yap_heap_regs->IntBBKeys
|
|
|
|
#define CharConversionTable Yap_heap_regs->char_conversion_table
|
|
|
|
#define CharConversionTable2 Yap_heap_regs->char_conversion_table2
|
2007-04-10 23:13:21 +01:00
|
|
|
#define CurrentModules Yap_heap_regs->current_modules
|
2006-04-28 14:23:23 +01:00
|
|
|
#define OpList Yap_heap_regs->op_list
|
2006-01-02 02:16:19 +00:00
|
|
|
#define FloatFormat Yap_heap_regs->float_format
|
2004-12-02 06:06:47 +00:00
|
|
|
#define TermDollarU Yap_heap_regs->term_dollar_u
|
|
|
|
#define TermProlog Yap_heap_regs->term_prolog
|
|
|
|
#define TermReFoundVar Yap_heap_regs->term_refound_var
|
2004-02-12 12:37:12 +00:00
|
|
|
#define PROLOG_MODULE 0
|
2004-12-02 06:06:47 +00:00
|
|
|
#define USER_MODULE Yap_heap_regs->user_module
|
|
|
|
#define IDB_MODULE Yap_heap_regs->idb_module
|
|
|
|
#define ATTRIBUTES_MODULE Yap_heap_regs->attributes_module
|
|
|
|
#define CHARSIO_MODULE Yap_heap_regs->charsio_module
|
|
|
|
#define TERMS_MODULE Yap_heap_regs->terms_module
|
2006-05-17 19:38:11 +01:00
|
|
|
#define SYSTEM_MODULE Yap_heap_regs->system_module
|
2006-08-02 19:18:31 +01:00
|
|
|
#define READUTIL_MODULE Yap_heap_regs->readutil_module
|
2006-12-27 01:32:38 +00:00
|
|
|
#define HACKS_MODULE Yap_heap_regs->hacks_module
|
2006-08-25 20:50:35 +01:00
|
|
|
#define GLOBALS_MODULE Yap_heap_regs->globals_module
|
2008-02-12 17:03:59 +00:00
|
|
|
#define ARG_MODULE Yap_heap_regs->arg_module
|
2007-10-10 10:44:28 +01:00
|
|
|
#define SWI_MODULE Yap_heap_regs->swi_module
|
2004-12-02 06:06:47 +00:00
|
|
|
#define PredGoalExpansion Yap_heap_regs->pred_goal_expansion
|
|
|
|
#define PredMetaCall Yap_heap_regs->pred_meta_call
|
|
|
|
#define PredDollarCatch Yap_heap_regs->pred_dollar_catch
|
|
|
|
#define PredRecordedWithKey Yap_heap_regs->pred_recorded_with_key
|
|
|
|
#define PredLogUpdClause Yap_heap_regs->pred_log_upd_clause
|
2008-01-23 17:57:56 +00:00
|
|
|
#define PredLogUpdClauseErase Yap_heap_regs->pred_log_upd_clause_erase
|
2004-12-02 06:06:47 +00:00
|
|
|
#define PredLogUpdClause0 Yap_heap_regs->pred_log_upd_clause0
|
|
|
|
#define PredStaticClause Yap_heap_regs->pred_static_clause
|
|
|
|
#define PredThrow Yap_heap_regs->pred_throw
|
|
|
|
#define PredHandleThrow Yap_heap_regs->pred_handle_throw
|
2009-02-09 21:56:40 +00:00
|
|
|
#define PredIs Yap_heap_regs->pred_is
|
2004-12-02 06:06:47 +00:00
|
|
|
#define DBErasedMarker Yap_heap_regs->db_erased_marker
|
2006-02-24 14:03:42 +00:00
|
|
|
#define LogDBErasedMarker Yap_heap_regs->logdb_erased_marker
|
2004-12-02 06:06:47 +00:00
|
|
|
#define DBErasedList Yap_heap_regs->db_erased_list
|
|
|
|
#define DBErasedIList Yap_heap_regs->db_erased_ilist
|
|
|
|
#define Yap_expand_clauses_sz Yap_heap_regs->expand_clauses_sz
|
|
|
|
#define Stream Yap_heap_regs->yap_streams
|
|
|
|
#define output_msg Yap_heap_regs->debugger_output_msg
|
|
|
|
#define NOfFileAliases Yap_heap_regs->n_of_file_aliases
|
|
|
|
#define SzOfFileAliases Yap_heap_regs->sz_of_file_aliases
|
|
|
|
#define FileAliases Yap_heap_regs->file_aliases
|
2003-05-20 20:11:59 +01:00
|
|
|
#if LOW_PROF
|
2004-12-02 06:06:47 +00:00
|
|
|
#define ProfilerOn Yap_heap_regs->profiler_on
|
2005-12-17 03:25:39 +00:00
|
|
|
#define Yap_OffLineProfiler Yap_heap_regs->offline_profiler
|
2005-05-26 19:03:08 +01:00
|
|
|
#define FProf Yap_heap_regs->f_prof
|
|
|
|
#define FPreds Yap_heap_regs->f_preds
|
2004-12-02 06:06:47 +00:00
|
|
|
#define ProfPreds Yap_heap_regs->prof_preds
|
2003-05-20 20:11:59 +01:00
|
|
|
#endif /* LOW_PROF */
|
2004-12-02 06:06:47 +00:00
|
|
|
#define ReductionsCounter Yap_heap_regs->call_counters.reductions
|
|
|
|
#define PredEntriesCounter Yap_heap_regs->call_counters.reductions_retries
|
|
|
|
#define RetriesCounter Yap_heap_regs->call_counters.retries
|
|
|
|
#define ReductionsCounterOn Yap_heap_regs->call_counters.reductions_on
|
|
|
|
#define PredEntriesCounterOn Yap_heap_regs->call_counters.reductions_retries_on
|
|
|
|
#define RetriesCounterOn Yap_heap_regs->call_counters.retries_on
|
|
|
|
#define Yap_LibDir Yap_heap_regs->yap_lib_dir
|
2007-02-18 00:26:36 +00:00
|
|
|
#define AGcLastCall Yap_heap_regs->agc_last_call
|
|
|
|
#define AGcThreshold Yap_heap_regs->agc_threshold
|
2004-12-02 06:06:47 +00:00
|
|
|
#define AGCHook Yap_heap_regs->agc_hook
|
|
|
|
#define ParserErrorStyle Yap_heap_regs->parser_error_style
|
2004-01-23 02:23:51 +00:00
|
|
|
#ifdef COROUTINING
|
2004-12-02 06:06:47 +00:00
|
|
|
#define WakeUpCode Yap_heap_regs->wake_up_code
|
2004-01-23 02:23:51 +00:00
|
|
|
#endif
|
|
|
|
#if defined(YAPOR) || defined(THREADS)
|
2004-12-02 06:06:47 +00:00
|
|
|
#define SignalLock Yap_heap_regs->wl[worker_id].signal_lock
|
|
|
|
#define WPP Yap_heap_regs->wl[worker_id].wpp
|
2005-12-05 17:16:12 +00:00
|
|
|
#define total_marked Yap_heap_regs->wl[worker_id].tot_marked
|
|
|
|
#define total_oldies Yap_heap_regs->wl[worker_id].tot_oldies
|
|
|
|
#if DEBUG
|
|
|
|
#ifdef COROUTINING
|
|
|
|
#define total_smarked Yap_heap_regs->wl[worker_id].tot_smarked
|
|
|
|
#endif
|
2005-12-07 17:53:30 +00:00
|
|
|
#endif /* DEBUG */
|
2005-12-05 17:16:12 +00:00
|
|
|
#define current_B Yap_heap_regs->wl[worker_id].wl_current_B
|
|
|
|
#define sTR Yap_heap_regs->wl[worker_id].wl_sTR
|
|
|
|
#define sTR0 Yap_heap_regs->wl[worker_id].wl_sTR0
|
|
|
|
#define prev_HB Yap_heap_regs->wl[worker_id].wl_prev_HB
|
2005-12-07 17:53:30 +00:00
|
|
|
#define new_TR Yap_heap_regs->wl[worker_id].new_tr
|
|
|
|
#define HGEN Yap_heap_regs->wl[worker_id].hgen
|
|
|
|
#define iptop Yap_heap_regs->wl[worker_id].ip_top
|
|
|
|
#define discard_trail_entries Yap_heap_regs->wl[worker_id].disc_trail_entries
|
|
|
|
#if GC_NO_TAGS
|
|
|
|
#define Yap_bp Yap_heap_regs->wl[worker_id].b_p
|
|
|
|
#endif /* GC_NO_TAGS */
|
|
|
|
#define gc_ma_hash_table Yap_heap_regs->wl[worker_id].Gc_ma_hash_table
|
|
|
|
#define gc_ma_h_top Yap_heap_regs->wl[worker_id].Gc_ma_h_top
|
2006-12-29 01:57:50 +00:00
|
|
|
#define gc_ma_h_list Yap_heap_regs->wl[worker_id].Gc_ma_h_list
|
2005-12-07 17:53:30 +00:00
|
|
|
#define gc_timestamp Yap_heap_regs->wl[worker_id].Gc_timestamp
|
|
|
|
#define cont_top0 Yap_heap_regs->wl[worker_id].conttop0
|
|
|
|
#define db_vec Yap_heap_regs->wl[worker_id].DB_vec
|
|
|
|
#define db_vec0 Yap_heap_regs->wl[worker_id].DB_vec0
|
|
|
|
#define db_root Yap_heap_regs->wl[worker_id].DB_root
|
|
|
|
#define db_nil Yap_heap_regs->wl[worker_id].DB_nil
|
|
|
|
#define cont_top Yap_heap_regs->wl[worker_id].conttop
|
2004-12-02 06:06:47 +00:00
|
|
|
#endif
|
2006-04-28 16:48:33 +01:00
|
|
|
#define OldASP RINFO.old_ASP
|
|
|
|
#define OldLCL0 RINFO.old_LCL0
|
|
|
|
#define OldTR RINFO.old_TR
|
|
|
|
#define OldGlobalBase RINFO.old_GlobalBase
|
|
|
|
#define OldH RINFO.old_H
|
|
|
|
#define OldH0 RINFO.old_H0
|
|
|
|
#define OldTrailBase RINFO.old_TrailBase
|
|
|
|
#define OldTrailTop RINFO.old_TrailTop
|
|
|
|
#define OldHeapBase RINFO.old_HeapBase
|
|
|
|
#define OldHeapTop RINFO.old_HeapTop
|
2008-01-23 17:57:56 +00:00
|
|
|
#define OldDelayTop RINFO.old_DelayTop
|
|
|
|
#define CurrentDelayTop RINFO.current_DelayTop
|
2006-04-28 16:48:33 +01:00
|
|
|
#define ClDiff RINFO.cl_diff
|
|
|
|
#define GDiff RINFO.g_diff
|
2006-08-22 17:12:46 +01:00
|
|
|
#define GDiff0 RINFO.g_diff0
|
|
|
|
#define GSplit RINFO.g_split
|
2006-04-28 16:48:33 +01:00
|
|
|
#define HDiff RINFO.h_diff
|
|
|
|
#define LDiff RINFO.l_diff
|
|
|
|
#define TrDiff RINFO.tr_diff
|
|
|
|
#define XDiff RINFO.x_diff
|
|
|
|
#define DelayDiff RINFO.delay_diff
|
2009-03-16 17:30:13 +00:00
|
|
|
#define BaseDiff RINFO.base_diff
|
2006-04-28 16:48:33 +01:00
|
|
|
/* current consult stack */
|
|
|
|
#define ConsultSp Yap_heap_regs->WL.consultsp
|
|
|
|
/* top of consult stack */
|
|
|
|
#define ConsultBase Yap_heap_regs->WL.consultbase
|
|
|
|
/* low-water mark for consult */
|
|
|
|
#define ConsultLow Yap_heap_regs->WL.consultlow
|
2009-02-10 23:42:26 +00:00
|
|
|
#define LastAssertedPred Yap_heap_regs->WL.last_asserted_pred
|
2006-04-28 16:48:33 +01:00
|
|
|
/* current maximum number of cells in consult stack */
|
|
|
|
#define ConsultCapacity Yap_heap_regs->WL.consultcapacity
|
2008-09-02 03:48:02 +01:00
|
|
|
#define DebugOn Yap_heap_regs->WL.debug_on
|
2006-04-28 16:48:33 +01:00
|
|
|
#define FormatInfo Yap_heap_regs->WL.f_info
|
2009-02-26 23:06:27 +00:00
|
|
|
#define DelayArenaOverflows Yap_heap_regs->WL.delay_arena_overflows
|
2009-02-27 00:31:29 +00:00
|
|
|
#define ArenaOverflows Yap_heap_regs->WL.arena_overflows
|
|
|
|
#define DepthArenas Yap_heap_regs->WL.depth_arenas
|
2006-04-28 16:48:33 +01:00
|
|
|
#define ScannerStack Yap_heap_regs->WL.scanner_stack
|
|
|
|
#define ScannerExtraBlocks Yap_heap_regs->WL.scanner_extra_blocks
|
|
|
|
#define Yap_BigTmp Yap_heap_regs->WL.big_tmp
|
|
|
|
#define ActiveSignals Yap_heap_regs->WL.active_signals
|
|
|
|
#define IPredArity Yap_heap_regs->WL.i_pred_arity
|
|
|
|
#define ProfEnd Yap_heap_regs->WL.prof_end
|
|
|
|
#define UncaughtThrow Yap_heap_regs->WL.uncaught_throw
|
|
|
|
#define DoingUndefp Yap_heap_regs->WL.doing_undefp
|
|
|
|
#define StartLine Yap_heap_regs->WL.start_line
|
|
|
|
#define ScratchPad Yap_heap_regs->WL.scratchpad
|
|
|
|
#ifdef COROUTINING
|
|
|
|
#define WokenGoals Yap_heap_regs->WL.woken_goals
|
|
|
|
#define AttsMutableList Yap_heap_regs->WL.atts_mutable_list
|
|
|
|
#endif
|
|
|
|
#define GcGeneration Yap_heap_regs->WL.gc_generation
|
|
|
|
#define GcPhase Yap_heap_regs->WL.gc_phase
|
|
|
|
#define GcCurrentPhase Yap_heap_regs->WL.gc_current_phase
|
|
|
|
#define GcCalls Yap_heap_regs->WL.gc_calls
|
|
|
|
#define TotGcTime Yap_heap_regs->WL.tot_gc_time
|
|
|
|
#define TotGcRecovered Yap_heap_regs->WL.tot_gc_recovered
|
2008-01-23 17:57:56 +00:00
|
|
|
#define LastGcTime Yap_heap_regs->WL.last_gc_time
|
|
|
|
#define LastSSTime Yap_heap_regs->WL.last_ss_time
|
2006-04-28 16:48:33 +01:00
|
|
|
#define Yap_gc_restore Yap_heap_regs->WL.gc_restore
|
|
|
|
#define TrustLUCode Yap_heap_regs->WL.trust_lu_code
|
|
|
|
#define DynamicArrays Yap_heap_regs->WL.dynamic_arrays
|
|
|
|
#define StaticArrays Yap_heap_regs->WL.static_arrays
|
2006-08-22 17:12:46 +01:00
|
|
|
#define GlobalVariables Yap_heap_regs->WL.global_variables
|
|
|
|
#define GlobalArena Yap_heap_regs->WL.global_arena
|
2007-09-17 23:17:49 +01:00
|
|
|
#define GlobalArenaOverflows Yap_heap_regs->WL.global_arena_overflows
|
2007-03-22 11:12:22 +00:00
|
|
|
#define Yap_AllowRestart Yap_heap_regs->WL.allow_restart
|
2006-08-22 17:12:46 +01:00
|
|
|
#define GlobalDelayArena Yap_heap_regs->WL.global_delay_arena
|
2004-12-02 06:06:47 +00:00
|
|
|
#define profiling Yap_heap_regs->compiler_profiling
|
|
|
|
#define call_counting Yap_heap_regs->compiler_call_counting
|
|
|
|
#define compile_arrays Yap_heap_regs->compiler_compile_arrays
|
|
|
|
#define optimizer_on Yap_heap_regs->compiler_optimizer_on
|
|
|
|
#define compile_mode Yap_heap_regs->compiler_compile_mode
|
|
|
|
#define P_before_spy Yap_heap_regs->debugger_p_before_spy
|
|
|
|
#define ForeignCodeBase Yap_heap_regs->foreign_code_base;
|
|
|
|
#define ForeignCodeTop Yap_heap_regs->foreign_code_top;
|
|
|
|
#define ForeignCodeMax Yap_heap_regs->foreign_code_max;
|
|
|
|
#define ForeignCodeLoaded Yap_heap_regs->foreign_code_loaded
|
2007-09-29 00:18:17 +01:00
|
|
|
#define PredHash Yap_heap_regs->pred_hash
|
|
|
|
#define PredHashRWLock Yap_heap_regs->pred_hash_rw_lock
|
|
|
|
#define PredsInHashTable Yap_heap_regs->preds_in_hash_table
|
|
|
|
#define PredHashTableSize Yap_heap_regs->pred_hash_table_size
|
|
|
|
#define PredHashInitialSize 1039L
|
|
|
|
#define PredHashIncrement 7919L
|
2004-12-02 06:06:47 +00:00
|
|
|
#define ParserErrorStyle Yap_heap_regs->parser_error_style
|
2007-12-05 12:17:25 +00:00
|
|
|
#define GlobalHoldEntry Yap_heap_regs->global_hold_entry
|
2006-03-22 20:07:28 +00:00
|
|
|
#define DeadStaticClauses Yap_heap_regs->dead_static_clauses
|
|
|
|
#define DeadMegaClauses Yap_heap_regs->dead_mega_clauses
|
2007-11-06 17:02:13 +00:00
|
|
|
#define DBTermsList Yap_heap_regs->dbterms_list
|
2006-03-22 20:07:28 +00:00
|
|
|
#define DeadStaticIndices Yap_heap_regs->dead_static_indices
|
2004-12-02 06:06:47 +00:00
|
|
|
#define SizeOfOverflow Yap_heap_regs->size_of_overflow
|
|
|
|
#define LastWtimePtr Yap_heap_regs->last_wtime
|
|
|
|
#define BGL Yap_heap_regs->bgl
|
|
|
|
#define FreeBlocks Yap_heap_regs->free_blocks
|
2001-04-09 20:54:03 +01:00
|
|
|
#if defined(YAPOR) || defined(THREADS)
|
2004-12-02 06:06:47 +00:00
|
|
|
#define FreeBlocksLock Yap_heap_regs->free_blocks_lock
|
|
|
|
#define HeapTopLock Yap_heap_regs->heap_top_lock
|
|
|
|
#define HeapTopOwner Yap_heap_regs->heap_top_owner
|
|
|
|
#define NOfThreads Yap_heap_regs->n_of_threads
|
|
|
|
#define NOfThreadsCreated Yap_heap_regs->n_of_threads_created
|
|
|
|
#define ThreadsTotalTime Yap_heap_regs->threads_total_time
|
2006-03-22 20:07:28 +00:00
|
|
|
#define DeadStaticClausesLock Yap_heap_regs->dead_static_clauses_lock
|
|
|
|
#define DeadMegaClausesLock Yap_heap_regs->dead_mega_clauses_lock
|
2007-11-06 17:02:13 +00:00
|
|
|
#define DBTermsListLock Yap_heap_regs->dbterms_list_lock
|
2006-03-22 20:07:28 +00:00
|
|
|
#define DeadStaticIndicesLock Yap_heap_regs->dead_static_indices_lock
|
2006-04-28 16:48:33 +01:00
|
|
|
#define ModulesLock Yap_heap_regs->modules_lock
|
2004-12-02 06:06:47 +00:00
|
|
|
#endif
|
|
|
|
#define CreepCode Yap_heap_regs->creep_code
|
|
|
|
#define UndefCode Yap_heap_regs->undef_code
|
|
|
|
#define SpyCode Yap_heap_regs->spy_code
|
2006-10-11 15:53:57 +01:00
|
|
|
#ifdef DEBUG
|
|
|
|
#define Yap_NewCps Yap_heap_regs->new_cps
|
|
|
|
#define Yap_LiveCps Yap_heap_regs->live_cps
|
|
|
|
#define Yap_DirtyCps Yap_heap_regs->dirty_cps
|
|
|
|
#define Yap_FreedCps Yap_heap_regs->freed_cps
|
|
|
|
#endif
|
2001-04-09 20:54:03 +01:00
|
|
|
#if defined(YAPOR) || defined(TABLING)
|
2004-12-02 06:06:47 +00:00
|
|
|
#define GLOBAL Yap_heap_regs->global
|
|
|
|
#define REMOTE Yap_heap_regs->remote
|
2003-11-05 18:55:03 +00:00
|
|
|
#endif /* YAPOR || TABLING */
|
2001-04-09 20:54:03 +01:00
|
|
|
|
|
|
|
#define UPDATE_MODE_IMMEDIATE 0
|
|
|
|
#define UPDATE_MODE_LOGICAL 1
|
|
|
|
#define UPDATE_MODE_LOGICAL_ASSERT 2
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef COROUTINING
|
2004-12-02 06:06:47 +00:00
|
|
|
#define NUM_OF_ATTS Yap_heap_regs->num_of_atts
|
2001-04-09 20:54:03 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* initially allow for files with up to 1024 predicates. This number
|
|
|
|
is extended whenever needed */
|
|
|
|
#define InitialConsultCapacity 1024
|
2001-06-11 18:40:16 +01:00
|
|
|
#if HAVE_LIBREADLINE
|
2004-12-02 06:06:47 +00:00
|
|
|
#define ReadlineBuf Yap_heap_regs->readline_buf
|
|
|
|
#define ReadlinePos Yap_heap_regs->readline_pos
|
2001-06-11 18:40:16 +01:00
|
|
|
#endif
|
2001-04-09 20:54:03 +01:00
|
|
|
|
2006-05-18 17:33:05 +01:00
|
|
|
|
2008-03-25 22:03:14 +00:00
|
|
|
#if (defined(USE_SYSTEM_MALLOC) && HAVE_MALLINFO)||USE_DL_MALLOC
|
2006-05-18 17:33:05 +01:00
|
|
|
UInt STD_PROTO(Yap_givemallinfo, (void));
|
|
|
|
#endif
|
|
|
|
|
2004-12-05 05:01:45 +00:00
|
|
|
ADDR STD_PROTO(Yap_ExpandPreAllocCodeSpace, (UInt, void *));
|
2004-02-05 16:57:02 +00:00
|
|
|
#define Yap_ReleasePreAllocCodeSpace(x)
|
|
|
|
ADDR STD_PROTO(Yap_InitPreAllocCodeSpace, (void));
|
|
|
|
EXTERN inline ADDR
|
|
|
|
Yap_PreAllocCodeSpace(void)
|
|
|
|
{
|
|
|
|
ADDR ptr = ScratchPad.ptr;
|
|
|
|
if (ptr) return ptr;
|
|
|
|
return Yap_InitPreAllocCodeSpace();
|
|
|
|
}
|
2004-01-23 02:23:51 +00:00
|
|
|
|
2004-02-05 16:57:02 +00:00
|
|
|
#endif /* HEAP_H */
|