restore clauses
This commit is contained in:
parent
5ca49ae202
commit
7a7354fb2b
@ -2,66 +2,66 @@
|
||||
/* This file, hglobals.h, was generated automatically by "yap -L misc/buildlocalglobal"
|
||||
please do not update, update misc/GLOBALS instead */
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// File defining fields in the Yap_GLOBAL global structure
|
||||
//
|
||||
// these fields used to spread all over the place, because they must be used in 3 ways:
|
||||
// - they must be defined somewhere
|
||||
// - they have an #ifdef to get a shorter name
|
||||
// - they must be initialised somewhere
|
||||
// - they may be of interest to restore
|
||||
//
|
||||
// The defs include 3+ components:
|
||||
// Type
|
||||
// name in structured / global name
|
||||
// init code (optional)
|
||||
// restore code (optional)
|
||||
//
|
||||
// Stuff that must be shared by all threads or workers
|
||||
typedef struct global_data {
|
||||
|
||||
// initialization: tell whether the system has been initialised and by whom.
|
||||
int Initialised_;
|
||||
int InitialisedFromPL_;
|
||||
int PL_Argc_;
|
||||
char** PL_Argv_;
|
||||
bool FAST_BOOT_FLAG_;
|
||||
|
||||
// halt hooks
|
||||
struct halt_hook* HaltHooks_;
|
||||
fptr_t JIT_finalizer_;
|
||||
|
||||
// stack overflow expansion/gc control
|
||||
int AllowLocalExpansion_;
|
||||
int AllowGlobalExpansion_;
|
||||
int AllowTrailExpansion_;
|
||||
UInt SizeOfOverflow_;
|
||||
|
||||
// amount of space recovered in all garbage collections
|
||||
UInt AGcThreshold_;
|
||||
Agc_hook AGCHook_;
|
||||
#if __ANDROID__
|
||||
|
||||
// no need to perform initialization, it is done before we start the Prolog engine.
|
||||
struct AAssetManager* assetManager_;
|
||||
char* AssetsWD_;
|
||||
#endif
|
||||
|
||||
/* multi-thread support */
|
||||
#if THREADS
|
||||
|
||||
/* number of threads and processes in system */
|
||||
UInt NOfThreads_;
|
||||
|
||||
/* number of threads created since start */
|
||||
UInt NOfThreadsCreated_;
|
||||
|
||||
/* total run time for dead threads */
|
||||
UInt ThreadsTotalTime_;
|
||||
|
||||
// Threads Array
|
||||
lockvar ThreadHandlesLock_;
|
||||
#endif
|
||||
#if defined(YAPOR) || defined(THREADS)
|
||||
|
||||
// protect long critical regions
|
||||
lockvar BGL_;
|
||||
#endif
|
||||
#if defined(YAPOR) || defined(TABLING)
|
||||
struct global_optyap_data optyap_data_;
|
||||
#endif /* YAPOR || TABLING */
|
||||
|
||||
// whether Yap is responsible for signal handling
|
||||
int PrologShouldHandleInterrupts_;
|
||||
|
||||
/* This is the guy who actually started the system, and who has the correct registers */
|
||||
#if defined(THREADS)
|
||||
pthread_t master_thread_;
|
||||
struct thread_mbox* named_mboxes_;
|
||||
@ -69,39 +69,39 @@ typedef struct global_data {
|
||||
UInt mbox_count_;
|
||||
struct swi_mutex* WithMutex_;
|
||||
#endif /* THREADS */
|
||||
|
||||
// streams
|
||||
struct stream_desc* Stream_;
|
||||
#if defined(THREADS)||defined(YAPOR)
|
||||
lockvar StreamDescLock_;
|
||||
#endif
|
||||
|
||||
// access to yap initial arguments
|
||||
char** argv_;
|
||||
int argc_;
|
||||
|
||||
// extensions to Terms
|
||||
#ifdef COROUTINING
|
||||
|
||||
/* array with the ops for your favourite extensions */
|
||||
ext_op attas_[attvars_ext+1];
|
||||
#endif
|
||||
|
||||
// agc.c
|
||||
int agc_calls_;
|
||||
YAP_ULONG_LONG agc_collected_;
|
||||
|
||||
/* total time spent in GC */
|
||||
Int tot_agc_time_;
|
||||
|
||||
/* number of heap objects in all garbage collections */
|
||||
Int tot_agc_recovered_;
|
||||
|
||||
//arrays.c
|
||||
#if HAVE_MMAP
|
||||
struct MMAP_ARRAY_BLOCK* mmap_arrays_;
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
|
||||
//computils.c
|
||||
char Option_[20];
|
||||
YP_FILE* logfile_;
|
||||
|
||||
|
||||
//init.c
|
||||
//int output_msg =FALSE
|
||||
#endif
|
||||
#if defined(COFF) || defined(A_OUT)
|
||||
|
||||
// loada_coff.c && load_aout.c
|
||||
char Executable_[YAP_FILENAME_MAX];
|
||||
#endif
|
||||
int OpaqueHandlersCount_;
|
||||
@ -109,10 +109,10 @@ typedef struct global_data {
|
||||
#if __simplescalar__
|
||||
char pwd_[YAP_FILENAME_MAX];
|
||||
#endif
|
||||
|
||||
|
||||
//udi.c
|
||||
//struct udi_control_block RtreeCmd void
|
||||
char* RestoreFile_;
|
||||
|
||||
//gprof.c
|
||||
Int ProfCalls_;
|
||||
Int ProfGCs_;
|
||||
Int ProfHGrows_;
|
||||
@ -129,18 +129,18 @@ typedef struct global_data {
|
||||
FILE* FProf_;
|
||||
FILE* FPreds_;
|
||||
#endif /* LOW_PROF */
|
||||
|
||||
// Mutexes
|
||||
#if THREADS
|
||||
struct swi_mutex* FreeMutexes_;
|
||||
struct swi_mutex* mutex_backbone_;
|
||||
lockvar MUT_ACCESS_;
|
||||
#endif
|
||||
char* Home_;
|
||||
|
||||
/* ISO char conversion: I will make no comments */
|
||||
char* CharConversionTable_;
|
||||
char* CharConversionTable2_;
|
||||
|
||||
/* time */
|
||||
void* LastWTimePtr_;
|
||||
|
||||
/* max priority */
|
||||
int MaxPriority_;
|
||||
} w_shared;
|
@ -2,9 +2,9 @@
|
||||
/* This file, hlocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
|
||||
please do not update, update misc/LOCALS instead */
|
||||
|
||||
|
||||
// Stuff that must be considered local to a thread or worker
|
||||
typedef struct worker_local {
|
||||
|
||||
// Streams
|
||||
struct AliasDescS* FileAliases_;
|
||||
int NOfFileAliases_;
|
||||
int SzOfFileAliases_;
|
||||
@ -13,10 +13,10 @@ typedef struct worker_local {
|
||||
int c_error_stream_;
|
||||
bool sockets_io_;
|
||||
bool within_print_message_;
|
||||
|
||||
|
||||
|
||||
|
||||
//
|
||||
// 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.
|
||||
//
|
||||
bool newline_;
|
||||
Atom AtPrompt_;
|
||||
char Prompt_[MAX_PROMPT+1];
|
||||
@ -27,7 +27,7 @@ typedef struct worker_local {
|
||||
UInt max_depth_;
|
||||
UInt max_list_;
|
||||
UInt max_write_args_;
|
||||
|
||||
// Restore info
|
||||
CELL* OldASP_;
|
||||
CELL* OldLCL0_;
|
||||
tr_fr_ptr OldTR_;
|
||||
@ -48,26 +48,26 @@ typedef struct worker_local {
|
||||
Int XDiff_;
|
||||
Int DelayDiff_;
|
||||
Int BaseDiff_;
|
||||
|
||||
// Reduction counters
|
||||
YAP_ULONG_LONG ReductionsCounter_;
|
||||
YAP_ULONG_LONG PredEntriesCounter_;
|
||||
YAP_ULONG_LONG RetriesCounter_;
|
||||
int ReductionsCounterOn_;
|
||||
int PredEntriesCounterOn_;
|
||||
int RetriesCounterOn_;
|
||||
|
||||
|
||||
// support for consulting files
|
||||
/* current consult stack */
|
||||
union CONSULT_OBJ* ConsultSp_;
|
||||
|
||||
/* current maximum number of cells in consult stack */
|
||||
UInt ConsultCapacity_;
|
||||
|
||||
/* top of consult stack */
|
||||
union CONSULT_OBJ* ConsultBase_;
|
||||
|
||||
/* low-water mark for consult */
|
||||
union CONSULT_OBJ* ConsultLow_;
|
||||
Term VarNames_;
|
||||
Atom SourceFileName_;
|
||||
UInt SourceFileLineno_;
|
||||
|
||||
//global variables
|
||||
Term GlobalArena_;
|
||||
UInt GlobalArenaOverflows_;
|
||||
Int ArenaOverflows_;
|
||||
@ -92,7 +92,7 @@ typedef struct worker_local {
|
||||
Term WokenGoals_;
|
||||
Term AttsMutableList_;
|
||||
#endif
|
||||
|
||||
// gc_stuff
|
||||
Term GcGeneration_;
|
||||
Term GcPhase_;
|
||||
UInt GcCurrentPhase_;
|
||||
@ -102,7 +102,7 @@ typedef struct worker_local {
|
||||
Int LastGcTime_;
|
||||
Int LastSSTime_;
|
||||
CELL* OpenArray_;
|
||||
|
||||
/* in a single gc */
|
||||
Int total_marked_;
|
||||
Int total_oldies_;
|
||||
struct choicept* current_B_;
|
||||
@ -135,16 +135,16 @@ typedef struct worker_local {
|
||||
struct static_array_entry* StaticArrays_;
|
||||
struct global_entry* GlobalVariables_;
|
||||
int AllowRestart_;
|
||||
|
||||
// Thread Local Area for Fast Storage of Intermediate Compiled Code
|
||||
struct mem_blk* CMemFirstBlock_;
|
||||
UInt CMemFirstBlockSz_;
|
||||
|
||||
// Variable used by the compiler to store number of permanent vars in a clause
|
||||
int nperm_;
|
||||
|
||||
// Thread Local Area for Labels
|
||||
Int* LabelFirstArray_;
|
||||
UInt LabelFirstArraySz_;
|
||||
|
||||
|
||||
// Thread Local Area for SWI-Prolog emulation routines.
|
||||
// struct PL_local_data* PL_local_data_p =Yap_InitThreadIO(wid)
|
||||
#ifdef THREADS
|
||||
struct thandle ThreadHandle_;
|
||||
#endif /* THREADS */
|
||||
@ -158,7 +158,7 @@ typedef struct worker_local {
|
||||
Int total_choicepoints_;
|
||||
#endif
|
||||
int consult_level_;
|
||||
|
||||
// Variables related to memory allocation
|
||||
ADDR LocalBase_;
|
||||
ADDR GlobalBase_;
|
||||
ADDR TrailBase_;
|
||||
@ -185,27 +185,27 @@ const char* Error_Function_;
|
||||
sigjmp_buf RestartEnv_;
|
||||
char FileNameBuf_[YAP_FILENAME_MAX];
|
||||
char FileNameBuf2_[YAP_FILENAME_MAX];
|
||||
|
||||
// Prolog State
|
||||
UInt BreakLevel_;
|
||||
Int PrologMode_;
|
||||
int CritLocks_;
|
||||
|
||||
// Prolog execution and state flags
|
||||
union flagTerm* Flags_;
|
||||
UInt flagCount_;
|
||||
|
||||
|
||||
//analyst.c
|
||||
/* used to find out how many instructions of each kind are executed */
|
||||
#ifdef ANALYST
|
||||
YAP_ULONG_LONG opcount_[_std_top+1];
|
||||
YAP_ULONG_LONG 2opcount[_std_top+1][_std_top+1]_;
|
||||
#endif /* ANALYST */
|
||||
|
||||
//dbase.c
|
||||
struct db_globs* s_dbg_;
|
||||
|
||||
//eval.c
|
||||
yap_error_number matherror_;
|
||||
Term mathtt_;
|
||||
char* mathstring_;
|
||||
yap_error_number CurrentError_;
|
||||
|
||||
//grow.c
|
||||
int heap_overflows_;
|
||||
Int total_heap_overflow_time_;
|
||||
int stack_overflows_;
|
||||
@ -216,15 +216,15 @@ const char* Error_Function_;
|
||||
Int total_trail_overflow_time_;
|
||||
int atom_table_overflows_;
|
||||
Int total_atom_table_overflow_time_;
|
||||
|
||||
//load_dyld
|
||||
#ifdef LOAD_DYLD
|
||||
int dl_errno_;
|
||||
#endif
|
||||
|
||||
//tracer.c
|
||||
#ifdef LOW_LEVEL_TRACER
|
||||
int do_trace_primitives_;
|
||||
#endif
|
||||
|
||||
//quick loader
|
||||
struct export_atom_hash_entry_struct *ExportAtomHashChain_;
|
||||
UInt ExportAtomHashTableSize_;
|
||||
UInt ExportAtomHashTableNum_;
|
||||
@ -253,23 +253,23 @@ const char* Error_Function_;
|
||||
UInt ImportDBRefHashTableNum_;
|
||||
yamop *ImportFAILCODE_;
|
||||
#if __ANDROID__
|
||||
|
||||
// current virtual directory.
|
||||
struct AAssetManager* assetManager_;
|
||||
char* InAssetDir_;
|
||||
#endif
|
||||
|
||||
// exo indexing
|
||||
UInt ibnds_[256];
|
||||
struct index_t* exo_it_;
|
||||
CELL* exo_base_;
|
||||
UInt exo_arity_;
|
||||
UInt exo_arg_;
|
||||
|
||||
// atom completion
|
||||
struct scan_atoms* search_atoms_;
|
||||
|
||||
// Slots
|
||||
yhandle_t CurSlot_;
|
||||
yhandle_t NSlots_;
|
||||
CELL* SlotBase_;
|
||||
|
||||
// Mutexes
|
||||
struct swi_mutex* Mutexes_;
|
||||
Term SourceModule_;
|
||||
Term Including_;
|
Reference in New Issue
Block a user