2015-09-21 23:05:36 +01:00
|
|
|
|
|
|
|
/* This file, hlocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
|
|
|
|
please do not update, update misc/LOCALS instead */
|
2014-06-22 17:35:05 +01:00
|
|
|
|
2016-01-03 02:02:41 +00:00
|
|
|
// Stuff that must be considered local to a thread or worker
|
2014-06-22 17:35:05 +01:00
|
|
|
typedef struct worker_local {
|
2016-01-03 02:02:41 +00:00
|
|
|
// Streams
|
2014-06-22 17:35:05 +01:00
|
|
|
int c_input_stream_;
|
|
|
|
int c_output_stream_;
|
|
|
|
int c_error_stream_;
|
2015-06-19 00:56:24 +01:00
|
|
|
bool sockets_io_;
|
2015-07-06 12:01:55 +01:00
|
|
|
bool within_print_message_;
|
2016-01-03 02:02:41 +00:00
|
|
|
//
|
|
|
|
// Used by the prompts to check if they are after a newline, and then a
|
|
|
|
// prompt should be output, or if we are in the middle of a line.
|
|
|
|
//
|
2015-06-19 00:56:24 +01:00
|
|
|
bool newline_;
|
|
|
|
Atom AtPrompt_;
|
|
|
|
char Prompt_[MAX_PROMPT+1];
|
2016-02-11 14:13:16 +00:00
|
|
|
encoding_t encoding_;
|
2015-06-19 00:56:24 +01:00
|
|
|
bool quasi_quotations_;
|
|
|
|
UInt default_priority_;
|
|
|
|
bool eot_before_eof_;
|
|
|
|
UInt max_depth_;
|
|
|
|
UInt max_list_;
|
|
|
|
UInt max_write_args_;
|
2016-01-03 02:02:41 +00:00
|
|
|
// Restore info
|
2014-06-22 17:35:05 +01:00
|
|
|
CELL* OldASP_;
|
|
|
|
CELL* OldLCL0_;
|
|
|
|
tr_fr_ptr OldTR_;
|
|
|
|
CELL* OldGlobalBase_;
|
|
|
|
CELL* OldH_;
|
|
|
|
CELL* OldH0_;
|
|
|
|
ADDR OldTrailBase_;
|
|
|
|
ADDR OldTrailTop_;
|
|
|
|
ADDR OldHeapBase_;
|
|
|
|
ADDR OldHeapTop_;
|
|
|
|
Int ClDiff_;
|
|
|
|
Int GDiff_;
|
|
|
|
Int HDiff_;
|
|
|
|
Int GDiff0_;
|
|
|
|
CELL* GSplit_;
|
|
|
|
Int LDiff_;
|
|
|
|
Int TrDiff_;
|
|
|
|
Int XDiff_;
|
|
|
|
Int DelayDiff_;
|
|
|
|
Int BaseDiff_;
|
2016-01-03 02:02:41 +00:00
|
|
|
// Reduction counters
|
2014-06-22 17:35:05 +01:00
|
|
|
YAP_ULONG_LONG ReductionsCounter_;
|
|
|
|
YAP_ULONG_LONG PredEntriesCounter_;
|
|
|
|
YAP_ULONG_LONG RetriesCounter_;
|
|
|
|
int ReductionsCounterOn_;
|
|
|
|
int PredEntriesCounterOn_;
|
|
|
|
int RetriesCounterOn_;
|
2016-01-03 02:02:41 +00:00
|
|
|
// support for consulting files
|
|
|
|
/* current consult stack */
|
2014-06-22 17:35:05 +01:00
|
|
|
union CONSULT_OBJ* ConsultSp_;
|
2016-01-03 02:02:41 +00:00
|
|
|
/* current maximum number of cells in consult stack */
|
2014-06-22 17:35:05 +01:00
|
|
|
UInt ConsultCapacity_;
|
2016-01-03 02:02:41 +00:00
|
|
|
/* top of consult stack */
|
2014-06-22 17:35:05 +01:00
|
|
|
union CONSULT_OBJ* ConsultBase_;
|
2016-01-03 02:02:41 +00:00
|
|
|
/* low-water mark for consult */
|
2014-06-22 17:35:05 +01:00
|
|
|
union CONSULT_OBJ* ConsultLow_;
|
2015-03-04 09:46:55 +00:00
|
|
|
Term VarNames_;
|
2015-06-19 00:56:24 +01:00
|
|
|
Atom SourceFileName_;
|
|
|
|
UInt SourceFileLineno_;
|
2016-01-03 02:02:41 +00:00
|
|
|
//global variables
|
2014-06-22 17:35:05 +01:00
|
|
|
Term GlobalArena_;
|
|
|
|
UInt GlobalArenaOverflows_;
|
|
|
|
Int ArenaOverflows_;
|
|
|
|
Int DepthArenas_;
|
|
|
|
int ArithError_;
|
|
|
|
struct pred_entry* LastAssertedPred_;
|
2014-11-27 10:02:04 +00:00
|
|
|
struct pred_entry* TmpPred_;
|
2014-06-22 17:35:05 +01:00
|
|
|
char* ScannerStack_;
|
|
|
|
struct scanner_extra_alloc* ScannerExtraBlocks_;
|
2016-03-29 02:02:43 +01:00
|
|
|
/// worker control information
|
|
|
|
/// pointer to an exception term, from throw
|
2014-06-22 17:35:05 +01:00
|
|
|
struct DB_TERM* BallTerm_;
|
2016-03-29 02:02:43 +01:00
|
|
|
/// stack limit after which the stack is managed by C-code.
|
|
|
|
Int CBorder_;
|
|
|
|
/// max number of signals (uint64_t)
|
2014-06-22 17:35:05 +01:00
|
|
|
UInt MaxActiveSignals_;
|
2016-03-29 02:02:43 +01:00
|
|
|
/// actual life signals
|
2014-09-02 20:19:23 +01:00
|
|
|
uint64_t Signals_;
|
2016-03-29 02:02:43 +01:00
|
|
|
/// indexing help data?
|
2014-06-22 17:35:05 +01:00
|
|
|
UInt IPredArity_;
|
|
|
|
yamop* ProfEnd_;
|
|
|
|
int DoingUndefp_;
|
2015-07-23 01:19:35 +01:00
|
|
|
Int StartCharCount_;
|
|
|
|
Int StartLineCount_;
|
|
|
|
Int StartLinePos_;
|
2014-06-22 17:35:05 +01:00
|
|
|
scratch_block ScratchPad_;
|
|
|
|
#ifdef COROUTINING
|
|
|
|
Term WokenGoals_;
|
|
|
|
Term AttsMutableList_;
|
|
|
|
#endif
|
2016-01-03 02:02:41 +00:00
|
|
|
// gc_stuff
|
2014-06-22 17:35:05 +01:00
|
|
|
Term GcGeneration_;
|
|
|
|
Term GcPhase_;
|
|
|
|
UInt GcCurrentPhase_;
|
|
|
|
UInt GcCalls_;
|
|
|
|
Int TotGcTime_;
|
|
|
|
YAP_ULONG_LONG TotGcRecovered_;
|
|
|
|
Int LastGcTime_;
|
|
|
|
Int LastSSTime_;
|
|
|
|
CELL* OpenArray_;
|
2016-01-03 02:02:41 +00:00
|
|
|
/* in a single gc */
|
2014-06-22 17:35:05 +01:00
|
|
|
Int total_marked_;
|
|
|
|
Int total_oldies_;
|
|
|
|
struct choicept* current_B_;
|
|
|
|
CELL* prev_HB_;
|
|
|
|
CELL* HGEN_;
|
|
|
|
CELL** iptop_;
|
|
|
|
#if defined(GC_NO_TAGS)
|
|
|
|
char* bp_;
|
|
|
|
#endif
|
|
|
|
tr_fr_ptr sTR_;
|
|
|
|
tr_fr_ptr sTR0_;
|
|
|
|
tr_fr_ptr new_TR_;
|
|
|
|
struct gc_mark_continuation* cont_top0_;
|
|
|
|
struct gc_mark_continuation* cont_top_;
|
|
|
|
int discard_trail_entries_;
|
|
|
|
gc_ma_hash_entry gc_ma_hash_table_[GC_MAVARS_HASH_SIZE];
|
|
|
|
gc_ma_hash_entry* gc_ma_h_top_;
|
|
|
|
gc_ma_hash_entry* gc_ma_h_list_;
|
|
|
|
UInt gc_timestamp_;
|
|
|
|
ADDR db_vec_;
|
|
|
|
ADDR db_vec0_;
|
|
|
|
struct RB_red_blk_node* db_root_;
|
|
|
|
struct RB_red_blk_node* db_nil_;
|
|
|
|
sigjmp_buf gc_restore_;
|
|
|
|
CELL* extra_gc_cells_;
|
|
|
|
CELL* extra_gc_cells_base_;
|
|
|
|
CELL* extra_gc_cells_top_;
|
|
|
|
UInt extra_gc_cells_size_;
|
|
|
|
struct array_entry* DynamicArrays_;
|
|
|
|
struct static_array_entry* StaticArrays_;
|
|
|
|
struct global_entry* GlobalVariables_;
|
|
|
|
int AllowRestart_;
|
2016-01-03 02:02:41 +00:00
|
|
|
// Thread Local Area for Fast Storage of Intermediate Compiled Code
|
2014-06-22 17:35:05 +01:00
|
|
|
struct mem_blk* CMemFirstBlock_;
|
|
|
|
UInt CMemFirstBlockSz_;
|
2016-01-03 02:02:41 +00:00
|
|
|
// Variable used by the compiler to store number of permanent vars in a clause
|
2014-06-22 17:35:05 +01:00
|
|
|
int nperm_;
|
2016-01-03 02:02:41 +00:00
|
|
|
// Thread Local Area for Labels
|
2014-06-22 17:35:05 +01:00
|
|
|
Int* LabelFirstArray_;
|
|
|
|
UInt LabelFirstArraySz_;
|
2016-01-03 02:02:41 +00:00
|
|
|
// Thread Local Area for SWI-Prolog emulation routines.
|
|
|
|
// struct PL_local_data* PL_local_data_p =Yap_InitThreadIO(wid)
|
2014-06-22 17:35:05 +01:00
|
|
|
#ifdef THREADS
|
|
|
|
struct thandle ThreadHandle_;
|
|
|
|
#endif /* THREADS */
|
|
|
|
#if defined(YAPOR) || defined(TABLING)
|
|
|
|
struct local_optyap_data optyap_data_;
|
2015-06-19 00:56:24 +01:00
|
|
|
UInt TabMode_;
|
2014-06-22 17:35:05 +01:00
|
|
|
#endif /* YAPOR || TABLING */
|
|
|
|
int InterruptsDisabled_;
|
|
|
|
struct open_query_struct* execution_;
|
|
|
|
#if LOW_LEVEL_TRACER
|
|
|
|
Int total_choicepoints_;
|
|
|
|
#endif
|
|
|
|
int consult_level_;
|
2016-01-03 02:02:41 +00:00
|
|
|
// Variables related to memory allocation
|
2014-06-22 17:35:05 +01:00
|
|
|
ADDR LocalBase_;
|
|
|
|
ADDR GlobalBase_;
|
|
|
|
ADDR TrailBase_;
|
|
|
|
ADDR TrailTop_;
|
|
|
|
char* ErrorMessage_;
|
|
|
|
Term Error_Term_;
|
|
|
|
yap_error_number Error_TYPE_;
|
2015-09-29 23:28:55 +01:00
|
|
|
const char* Error_File_;
|
|
|
|
const char* Error_Function_;
|
|
|
|
int Error_Lineno_;
|
|
|
|
size_t Error_Size_;
|
2014-06-22 17:35:05 +01:00
|
|
|
char ErrorSay_[MAX_ERROR_MSG_SIZE];
|
|
|
|
jmp_buf IOBotch_;
|
|
|
|
TokEntry* tokptr_;
|
|
|
|
TokEntry* toktide_;
|
|
|
|
VarEntry* VarTable_;
|
|
|
|
VarEntry* AnonVarTable_;
|
|
|
|
Term Comments_;
|
|
|
|
CELL* CommentsTail_;
|
|
|
|
CELL* CommentsNextChar_;
|
|
|
|
wchar_t* CommentsBuff_;
|
|
|
|
size_t CommentsBuffPos_;
|
|
|
|
size_t CommentsBuffLim_;
|
|
|
|
sigjmp_buf RestartEnv_;
|
|
|
|
char FileNameBuf_[YAP_FILENAME_MAX];
|
|
|
|
char FileNameBuf2_[YAP_FILENAME_MAX];
|
2016-01-03 02:02:41 +00:00
|
|
|
// Prolog State
|
2015-06-19 00:56:24 +01:00
|
|
|
UInt BreakLevel_;
|
2014-06-22 17:35:05 +01:00
|
|
|
Int PrologMode_;
|
|
|
|
int CritLocks_;
|
2016-01-03 02:02:41 +00:00
|
|
|
// Prolog execution and state flags
|
2015-06-19 00:56:24 +01:00
|
|
|
union flagTerm* Flags_;
|
|
|
|
UInt flagCount_;
|
2016-01-03 02:02:41 +00:00
|
|
|
//analyst.c
|
|
|
|
/* used to find out how many instructions of each kind are executed */
|
2014-06-22 17:35:05 +01:00
|
|
|
#ifdef ANALYST
|
|
|
|
YAP_ULONG_LONG opcount_[_std_top+1];
|
|
|
|
YAP_ULONG_LONG 2opcount[_std_top+1][_std_top+1]_;
|
|
|
|
#endif /* ANALYST */
|
2016-01-03 02:02:41 +00:00
|
|
|
//dbase.c
|
2014-06-22 17:35:05 +01:00
|
|
|
struct db_globs* s_dbg_;
|
2016-01-03 02:02:41 +00:00
|
|
|
//eval.c
|
2014-06-22 17:35:05 +01:00
|
|
|
yap_error_number matherror_;
|
2014-10-16 10:49:11 +01:00
|
|
|
Term mathtt_;
|
|
|
|
char* mathstring_;
|
2014-06-22 17:35:05 +01:00
|
|
|
yap_error_number CurrentError_;
|
2016-01-03 02:02:41 +00:00
|
|
|
//grow.c
|
2014-06-22 17:35:05 +01:00
|
|
|
int heap_overflows_;
|
|
|
|
Int total_heap_overflow_time_;
|
|
|
|
int stack_overflows_;
|
|
|
|
Int total_stack_overflow_time_;
|
|
|
|
int delay_overflows_;
|
|
|
|
Int total_delay_overflow_time_;
|
|
|
|
int trail_overflows_;
|
|
|
|
Int total_trail_overflow_time_;
|
|
|
|
int atom_table_overflows_;
|
|
|
|
Int total_atom_table_overflow_time_;
|
2016-01-03 02:02:41 +00:00
|
|
|
//load_dyld
|
2014-06-22 17:35:05 +01:00
|
|
|
#ifdef LOAD_DYLD
|
|
|
|
int dl_errno_;
|
|
|
|
#endif
|
2016-01-03 02:02:41 +00:00
|
|
|
//tracer.c
|
2014-06-22 17:35:05 +01:00
|
|
|
#ifdef LOW_LEVEL_TRACER
|
|
|
|
int do_trace_primitives_;
|
|
|
|
#endif
|
2016-01-03 02:02:41 +00:00
|
|
|
//quick loader
|
2014-06-22 17:35:05 +01:00
|
|
|
struct export_atom_hash_entry_struct *ExportAtomHashChain_;
|
|
|
|
UInt ExportAtomHashTableSize_;
|
|
|
|
UInt ExportAtomHashTableNum_;
|
|
|
|
struct export_functor_hash_entry_struct *ExportFunctorHashChain_;
|
|
|
|
UInt ExportFunctorHashTableSize_;
|
|
|
|
UInt ExportFunctorHashTableNum_;
|
|
|
|
struct export_pred_entry_hash_entry_struct *ExportPredEntryHashChain_;
|
|
|
|
UInt ExportPredEntryHashTableSize_;
|
|
|
|
UInt ExportPredEntryHashTableNum_;
|
|
|
|
struct export_dbref_hash_entry_struct *ExportDBRefHashChain_;
|
|
|
|
UInt ExportDBRefHashTableSize_;
|
|
|
|
UInt ExportDBRefHashTableNum_;
|
|
|
|
struct import_atom_hash_entry_struct **ImportAtomHashChain_;
|
|
|
|
UInt ImportAtomHashTableSize_;
|
|
|
|
UInt ImportAtomHashTableNum_;
|
|
|
|
struct import_functor_hash_entry_struct **ImportFunctorHashChain_;
|
|
|
|
UInt ImportFunctorHashTableSize_;
|
|
|
|
UInt ImportFunctorHashTableNum_;
|
|
|
|
struct import_opcode_hash_entry_struct **ImportOPCODEHashChain_;
|
|
|
|
UInt ImportOPCODEHashTableSize_;
|
|
|
|
struct import_pred_entry_hash_entry_struct **ImportPredEntryHashChain_;
|
|
|
|
UInt ImportPredEntryHashTableSize_;
|
|
|
|
UInt ImportPredEntryHashTableNum_;
|
|
|
|
struct import_dbref_hash_entry_struct **ImportDBRefHashChain_;
|
|
|
|
UInt ImportDBRefHashTableSize_;
|
|
|
|
UInt ImportDBRefHashTableNum_;
|
|
|
|
yamop *ImportFAILCODE_;
|
|
|
|
#if __ANDROID__
|
2016-01-03 02:02:41 +00:00
|
|
|
// current virtual directory.
|
2014-06-22 17:35:05 +01:00
|
|
|
struct AAssetManager* assetManager_;
|
|
|
|
char* InAssetDir_;
|
|
|
|
#endif
|
2016-01-03 02:02:41 +00:00
|
|
|
// exo indexing
|
2014-06-22 17:35:05 +01:00
|
|
|
UInt ibnds_[256];
|
|
|
|
struct index_t* exo_it_;
|
|
|
|
CELL* exo_base_;
|
|
|
|
UInt exo_arity_;
|
|
|
|
UInt exo_arg_;
|
2016-01-03 02:02:41 +00:00
|
|
|
// atom completion
|
2014-06-22 17:35:05 +01:00
|
|
|
struct scan_atoms* search_atoms_;
|
2016-01-03 02:02:41 +00:00
|
|
|
// Slots
|
2014-06-22 17:35:05 +01:00
|
|
|
yhandle_t CurSlot_;
|
2015-01-30 07:25:34 +00:00
|
|
|
yhandle_t NSlots_;
|
|
|
|
CELL* SlotBase_;
|
2016-01-03 02:02:41 +00:00
|
|
|
// Mutexes
|
2014-11-27 10:02:04 +00:00
|
|
|
struct swi_mutex* Mutexes_;
|
2014-06-22 17:35:05 +01:00
|
|
|
Term SourceModule_;
|
2015-09-21 23:05:36 +01:00
|
|
|
Term Including_;
|
2014-06-22 17:35:05 +01:00
|
|
|
size_t MAX_SIZE_;
|
2016-02-29 03:13:23 +00:00
|
|
|
/* last call to walltime. */
|
|
|
|
uint64_t LastWTime_;
|
2014-06-22 17:35:05 +01:00
|
|
|
} w_local;
|