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 *
|
|
|
|
* *
|
|
|
|
**************************************************************************
|
|
|
|
* *
|
2009-10-23 14:22:17 +01:00
|
|
|
* File: YapHeap.h *
|
2001-04-09 20:54:03 +01:00
|
|
|
* 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
|
|
|
|
|
2009-11-23 13:52:13 +00:00
|
|
|
#if LOW_PROF
|
|
|
|
#include <stdio.h>
|
|
|
|
#endif
|
|
|
|
|
2008-03-25 16:45:53 +00:00
|
|
|
#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;
|
|
|
|
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;
|
2009-12-02 21:59:41 +00:00
|
|
|
struct DB_TERM *ball_term;
|
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;
|
2009-05-21 06:38:04 +01:00
|
|
|
int interrupts_disabled;
|
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;
|
2009-07-08 16:32:14 +01:00
|
|
|
int arith_error;
|
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;
|
2009-10-30 23:59:00 +00:00
|
|
|
struct reduction_counters call_counters;
|
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;
|
2004-11-04 18:22:36 +00:00
|
|
|
yamop trust_lu_code[3];
|
2010-01-14 15:58:19 +00:00
|
|
|
#if (defined(YAPOR) || defined(TABLING) ) && defined(THREADS)
|
|
|
|
#ifdef YAPOR
|
|
|
|
struct worker worker;
|
|
|
|
#endif /* YAPOR */
|
|
|
|
#endif
|
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;
|
2010-02-10 09:03:03 +00:00
|
|
|
pthread_t pthread_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;
|
2010-02-10 09:03:03 +00:00
|
|
|
#if HAVE_GETRUSAGE||defined(_WIN32)
|
2004-03-02 16:44:58 +00:00
|
|
|
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 {
|
2009-10-27 10:48:37 +00:00
|
|
|
/* memory allocation and management */
|
2001-04-09 20:54:03 +01:00
|
|
|
special_functors funcs;
|
2009-10-27 10:48:37 +00:00
|
|
|
|
2009-10-28 13:11:35 +00:00
|
|
|
#include "hstruct.h"
|
2009-10-27 10:48:37 +00:00
|
|
|
|
|
|
|
|
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 */
|
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-01-02 02:16:19 +00:00
|
|
|
#define FloatFormat Yap_heap_regs->float_format
|
2009-10-30 23:59:00 +00:00
|
|
|
|
2004-02-12 12:37:12 +00:00
|
|
|
#define PROLOG_MODULE 0
|
2009-10-30 23:59:00 +00:00
|
|
|
|
2009-10-28 13:11:35 +00:00
|
|
|
#include "dhstruct.h"
|
2009-10-30 23:59:00 +00:00
|
|
|
|
2004-01-23 02:23:51 +00:00
|
|
|
#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
|
|
|
|
#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
|
2009-10-30 23:59:00 +00:00
|
|
|
|
|
|
|
#define ReductionsCounter Yap_heap_regs->WL.call_counters.reductions
|
|
|
|
#define PredEntriesCounter Yap_heap_regs->WL.call_counters.reductions_retries
|
|
|
|
#define RetriesCounter Yap_heap_regs->WL.call_counters.retries
|
|
|
|
#define ReductionsCounterOn Yap_heap_regs->WL.call_counters.reductions_on
|
|
|
|
#define PredEntriesCounterOn Yap_heap_regs->WL.call_counters.reductions_retries_on
|
|
|
|
#define RetriesCounterOn Yap_heap_regs->WL.call_counters.retries_on
|
|
|
|
|
2009-05-21 06:38:04 +01:00
|
|
|
#define Yap_InterruptsDisabled Yap_heap_regs->WL.interrupts_disabled
|
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-07-08 16:32:14 +01:00
|
|
|
#define ArithError Yap_heap_regs->WL.arith_error
|
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
|
2009-12-02 21:59:41 +00:00
|
|
|
#define BallTerm Yap_heap_regs->WL.ball_term
|
2006-04-28 16:48:33 +01:00
|
|
|
#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
|
2009-10-28 13:11:35 +00:00
|
|
|
|
2007-09-29 00:18:17 +01:00
|
|
|
#define PredHashInitialSize 1039L
|
|
|
|
#define PredHashIncrement 7919L
|
2009-10-28 13:11:35 +00:00
|
|
|
|
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
|
2010-01-14 15:58:19 +00:00
|
|
|
#ifdef THREADS
|
|
|
|
#define WORKER Yap_heap_regs->WL.worker
|
|
|
|
#endif
|
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
|
|
|
|
|
|
|
|
|
|
|
|
/* initially allow for files with up to 1024 predicates. This number
|
|
|
|
is extended whenever needed */
|
|
|
|
#define InitialConsultCapacity 1024
|
|
|
|
|
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
|
|
|
|
|
2009-05-23 00:35:24 +01:00
|
|
|
ADDR STD_PROTO(Yap_ExpandPreAllocCodeSpace, (UInt, void *, int));
|
2004-02-05 16:57:02 +00:00
|
|
|
#define Yap_ReleasePreAllocCodeSpace(x)
|
|
|
|
ADDR STD_PROTO(Yap_InitPreAllocCodeSpace, (void));
|
|
|
|
EXTERN inline ADDR
|
2009-05-23 00:35:24 +01:00
|
|
|
Yap_PreAllocCodeSpace(void)
|
2004-02-05 16:57:02 +00:00
|
|
|
{
|
2009-05-23 00:35:24 +01:00
|
|
|
return AuxBase;
|
2004-02-05 16:57:02 +00:00
|
|
|
}
|
2004-01-23 02:23:51 +00:00
|
|
|
|
2004-02-05 16:57:02 +00:00
|
|
|
#endif /* HEAP_H */
|