2010-03-21 22:12:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								//
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// 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
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-25 18:01:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								START_GLOBAL_DATA
							 | 
						
					
						
							
								
									
										
										
										
											2010-03-21 22:12:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-05-09 19:36:51 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								// initialization: tell whether the system has been initialised and by whom.
							 | 
						
					
						
							
								
									
										
										
										
											2011-05-10 10:06:51 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								int		initialised		GLOBAL_Initialised		=FALSE
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								int		initialised_from_pl	GLOBAL_InitialisedFromPL	=FALSE
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								int		pl_argc			GLOBAL_PL_Argc		=0
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								char	      **pl_argv			GLOBAL_PL_Argv		=NULL
							 | 
						
					
						
							
								
									
										
										
										
											2011-05-09 19:36:51 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// halt hooks
							 | 
						
					
						
							
								
									
										
										
										
											2011-05-10 10:06:51 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								struct halt_hook *yap_halt_hook		GLOBAL_HaltHooks		=NULL
							 | 
						
					
						
							
								
									
										
										
										
											2011-05-09 19:36:51 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// stack overflow expansion/gc control
							 | 
						
					
						
							
								
									
										
										
										
											2011-05-10 10:06:51 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								int		allow_local_expansion	GLOBAL_AllowLocalExpansion =TRUE
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								int		allow_global_expansion	GLOBAL_AllowGlobalExpansion =TRUE
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								int		allow_trail_expansion	GLOBAL_AllowTrailExpansion =TRUE
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								UInt		size_of_overflow	GLOBAL_SizeOfOverflow		=0
							 | 
						
					
						
							
								
									
										
										
										
											2011-05-10 12:20:22 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-05-09 19:36:51 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								// amount of space recovered in all garbage collections
							 | 
						
					
						
							
								
									
										
										
										
											2011-05-10 10:06:51 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								UInt		agc_threshold		GLOBAL_AGcThreshold		=10000
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Agc_hook	agc_hook		GLOBAL_AGCHook			=NULL
							 | 
						
					
						
							
								
									
										
										
										
											2011-05-09 19:36:51 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2010-03-21 22:12:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								/* multi-thread support */
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#if THREADS
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								/* number of threads and processes in system */
							 | 
						
					
						
							
								
									
										
										
										
											2011-05-10 10:06:51 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								UInt		n_of_threads		GLOBAL_NOfThreads	=1
							 | 
						
					
						
							
								
									
										
										
										
											2010-03-21 22:12:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								/* number of threads created since start */
							 | 
						
					
						
							
								
									
										
										
										
											2011-05-10 10:06:51 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								UInt		n_of_threads_created	GLOBAL_NOfThreadsCreated =1
							 | 
						
					
						
							
								
									
										
										
										
											2010-03-21 22:12:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								/* total run time for dead threads */
							 | 
						
					
						
							
								
									
										
										
										
											2011-05-10 10:06:51 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								UInt  threads_total_time		GLOBAL_ThreadsTotalTime =0L
							 | 
						
					
						
							
								
									
										
										
										
											2010-03-21 22:12:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// multi-thread/ORP support
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#if defined(YAPOR) || defined(THREADS)
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// protect long critical regions
							 | 
						
					
						
							
								
									
										
										
										
											2011-05-10 10:06:51 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								lockvar		bgl			GLOBAL_BGL		MkLock
							 | 
						
					
						
							
								
									
										
										
										
											2010-03-21 22:12:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#endif
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								// Threads Array
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#ifdef THREADS
							 | 
						
					
						
							
								
									
										
										
										
											2011-05-10 10:06:51 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								lockvar		thread_handles_lock	GLOBAL_ThreadHandlesLock	MkLock
							 | 
						
					
						
							
								
									
										
										
										
											2010-03-21 22:12:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#endif 
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								#if defined(YAPOR) || defined(TABLING)
							 | 
						
					
						
							
								
									
										
										
										
											2011-04-07 16:30:56 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								struct global_optyap_data	optyap_data	Yap_optyap_data	void	
							 | 
						
					
						
							
								
									
										
										
										
											2011-05-09 19:36:51 +01:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								#endif /* YAPOR || TABLING */
							 | 
						
					
						
							
								
									
										
										
										
											2010-11-29 18:08:29 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2011-03-25 18:01:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								END_GLOBAL_DATA
							 | 
						
					
						
							
								
									
										
										
										
											2010-03-21 22:12:42 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 |