1 
2   /* This file, hglobals.h, was generated automatically by "yap -L misc/buildheap"
3      please do not update, update misc/GLOBALS instead */
4 
5 
6 
7 
8 
9 
10 
11 
12 
13 
14 
15 
16 
17 
18 
19 
20 
21 
22 
23 typedef struct worker_local {
24 
25   int  c_input_stream;
26   int  c_output_stream;
27   int  c_error_stream;
28 
29   restoreinfo  rinfo;
30 
31 
32 
33 
34 
35 
36 
37 
38 
39 
40 
41 
42 
43 
44 
45 
46 
47 
48 
49 
50   struct reduction_counters  call_counters;
51 
52 
53 
54 
55 
56 
57   int  interrupts_disabled;
58 
59 
60   union CONSULT_OBJ*  consultsp;
61 
62   UInt  consultcapacity;
63 
64   union CONSULT_OBJ*  consultbase;
65 
66   union CONSULT_OBJ*  consultlow;
67 
68   Term  global_arena;
69   UInt  global_arena_overflows;
70   Int  delay_arena_overflows;
71   Int  arena_overflows;
72   Int  depth_arenas;
73   int  arith_error;
74   struct pred_entry*  last_asserted_pred;
75   int  debug_on;
76   struct format_status*  f_info;
77   char*  scanner_stack;
78   struct scanner_extra_alloc*  scanner_extra_blocks;
79   struct DB_TERM  *ball_term;
80   UInt  active_signals;
81   UInt  i_pred_arity;
82   yamop*  prof_end;
83   int  uncaught_throw;
84   int  doing_undefp;
85   Int  start_line;
86   scratch_block  scratchpad;
87 #ifdef  COROUTINING
88   Term  woken_goals;
89   Term  atts_mutable_list;
90 #endif
91 
92   Term  gc_generation;
93   Term  gc_phase;
94   UInt  gc_current_phase;
95   UInt  gc_calls;
96   Int  tot_gc_time;
97   YAP_ULONG_LONG  tot_gc_recovered;
98   Int  last_gc_time;
99   Int  last_ss_time;
100 #if LOW_LEVEL_TRACER
101   Int  total_cps;
102 #endif
103   int  consult_level_;
104 
105 #if defined(YAPOR) || defined(THREADS)
106   lockvar  signal_lock;
107   struct pred_entry*  wpp;
108 
109   Int  tot_marked;
110   Int  tot_oldies;
111 #if DEBUG && COROUTINING
112   UInt  tot_smarked;
113 #endif
114   struct choicept  *wl_current_B;
115   CELL*  wl_prev_HB;
116   CELL*  hgen;
117   CELL**  ip_top;
118 #if GC_NO_TAGS
119   char*  b_p;
120 #endif
121 #if defined(TABLING) || defined(SBA)
122   struct trail_frame*  wl_sTR;
123   struct trail_frame*  wl_sTR0;
124   struct trail_frame*  new_tr;
125 #else
126   Term  *wl_sTR;
127   Term  *wl_sTR0;
128   Term  *new_tr;
129 #endif
130   struct gc_mark_continuation*  conttop0;
131   struct gc_mark_continuation*  conttop;
132   int  disc_trail_entries;
133   gc_ma_hash_entry  Gc_ma_hash_table[GC_MAVARS_HASH_SIZE];
134   gc_ma_hash_entry*  Gc_ma_h_top;
135   gc_ma_hash_entry*  Gc_ma_h_list;
136   UInt  Gc_timestamp;
137   ADDR  DB_vec;
138   ADDR  DB_vec0;
139   struct RB_red_blk_node*  DB_root;
140   struct RB_red_blk_node*  DB_nil;
141 #endif /* defined(YAPOR) || defined(THREADS) */
142   sigjmp_buf  gc_restore;
143   struct array_entry*  dynamic_arrays;
144   struct static_array_entry*  static_arrays;
145   struct global_entry*  global_variables;
146   int  allow_restart;
147 
148   struct mem_blk*  cmem_first_block;
149   UInt  cmem_first_block_sz;
150 
151   Int*  label_first_array;
152   UInt  label_first_array_sz;
153 
154   char*  putc_curp_;
155   char*  putc_cur_buf_;
156   char*  putc_cur_lim_;
157   UInt  putc_cur_flags_;
158   char*  SWI_buffers_[1+SWI_BUF_RINGS];
159   size_t  SWI_buffers_sz_[1+SWI_BUF_RINGS];
160   int  SWI_buf_index_;
161   struct open_query_struct*  _execution;
162 
163 #if (defined(YAPOR) || defined(TABLING)) && defined(THREADS)
164   struct worker  worker;
165 #endif
166 #ifdef THREADS
167   struct thandle  thread_handle;
168 #define FOREIGN_ThreadHandle(wid)  (Yap_WLocal[(wid)].thread_handle)
169 #define MY_ThreadHandle	       (Yap_WLocal[worker_id].thread_handle)
170 #endif
171 
172 } w_local;
173 
174 typedef struct worker_shared {
175 
176 #if THREADS
177 
178   UInt  n_of_threads;
179 
180   UInt  n_of_threads_created;
181 
182   UInt  threads_total_time;
183 #endif
184 
185 #if defined(YAPOR) || defined(THREADS)
186 
187   lockvar  bgl;
188 #endif
189   Functor  f_swi_stream;
190   SWI_GetFunction  swi_getc;
191   SWI_PutFunction  swi_putc;
192   SWI_GetWideFunction  swi_wgetc;
193   SWI_PutWideFunction  swi_wputc;
194   SWI_CloseFunction  swi_close;
195   SWI_FlushFunction  swi_flush;
196   SWI_PLGetStreamFunction  swi_get_stream_f;
197   SWI_PLGetStreamPositionFunction  swi_get_stream_position_f;
198 
199   int  allow_local_expansion;
200   int  allow_global_expansion;
201   int  allow_trail_expansion;
202   UInt  size_of_overflow;
203 
204   UInt  agc_last_call;
205 
206   UInt  agc_threshold;
207   Agc_hook  agc_hook;
208 
209 #if HAVE_LIBREADLINE
210   char  *readline_buf;
211   char  *readline_pos;
212 #endif
213 
214 #ifdef THREADS
215   lockvar  thread_handles_lock;
216 #endif
217 
218 #if defined(YAPOR) || defined(TABLING)
219   struct global_data  global;
220   struct local_data  remote[MAX_WORKERS];
221 #endif
222 
223   int  initialised;
224   int  initialised_from_pl;
225   int  pl_argc;
226   char  **pl_argv;
227 
228   struct halt_hook  *yap_halt_hook;
229 } w_shared;
230