This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
yap-6.3/misc/GLOBALS

74 lines
2.1 KiB
Plaintext
Raw Normal View History

//
// 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 4+ components:
// Type
// name in structured
// global name
// init code (optional)
// restore code (optional)
//
//
// Stuff that must be shared by all threads or workers
START_GLOBAL_DATA
/* multi-thread support */
#if THREADS
/* number of threads and processes in system */
2011-03-29 18:19:18 +01:00
UInt n_of_threads Yap_NOfThreads =1
/* number of threads created since start */
2011-03-29 18:19:18 +01:00
UInt n_of_threads_created Yap_NOfThreadsCreated =1
/* total run time for dead threads */
2011-03-29 18:19:18 +01:00
UInt threads_total_time Yap_ThreadsTotalTime =0L
#endif
// multi-thread/ORP support
#if defined(YAPOR) || defined(THREADS)
// protect long critical regions
2011-03-29 18:19:18 +01:00
lockvar bgl Yap_BGL MkLock
#endif
// stack overflow expansion/gc control
int allow_local_expansion Yap_AllowLocalExpansion =TRUE
int allow_global_expansion Yap_AllowGlobalExpansion =TRUE
int allow_trail_expansion Yap_AllowTrailExpansion =TRUE
2011-03-29 18:19:18 +01:00
UInt size_of_overflow Yap_SizeOfOverflow =0
// amount of space recovered in all garbage collections
2011-03-29 18:19:18 +01:00
UInt agc_last_call Yap_AGcLastCall =0
// amount of space recovered in all garbage collections
2011-03-29 18:19:18 +01:00
UInt agc_threshold Yap_AGcThreshold =10000
Agc_hook agc_hook Yap_AGCHook =NULL
// Threads Array
#ifdef THREADS
2011-03-29 18:19:18 +01:00
lockvar thread_handles_lock Yap_ThreadHandlesLock MkLock
#endif
// Ricardo's stuff
#if defined(YAPOR) || defined(TABLING)
struct global_optyap_data optyap_data Yap_optyap_data void
struct local_data remote[MAX_WORKERS] REMOTE void
#endif
2010-04-13 00:31:48 +01:00
// initialization: tell whether the system has been initialised and by whom.
int initialised Yap_Initialised =FALSE
int initialised_from_pl Yap_InitialisedFromPL =FALSE
int pl_argc Yap_PL_Argc =0
char **pl_argv Yap_PL_Argv =NULL
// halt hooks
struct halt_hook *yap_halt_hook Yap_HaltHooks =NULL
END_GLOBAL_DATA