Commit | Line | Data |
cb68f92d |
1 | /***********************************************/ |
2 | /* Global only to current thread */ |
3 | /***********************************************/ |
4 | |
8b3be1d1 |
5 | /* Don't forget to re-run embed.pl to propagate changes! */ |
6 | |
cb68f92d |
7 | /* The 'T' prefix is only needed for vars that need appropriate #defines |
8 | * generated when built with or without USE_THREADS. It is also used |
9 | * to generate the appropriate export list for win32. |
10 | * |
11 | * When building without USE_THREADS, these variables will be truly global. |
12 | * When building without USE_THREADS but with MULTIPLICITY, these variables |
13 | * will be global per-interpreter. |
14 | * |
15 | * Avoid build-specific #ifdefs here, like DEBUGGING. That way, |
16 | * we can keep binary compatibility of the curinterp structure */ |
8b3be1d1 |
17 | |
49f531da |
18 | /* Important ones in the first cache line (if alignment is done right) */ |
d4cce5f1 |
19 | |
cb68f92d |
20 | PERLVAR(Tstack_sp, SV **) /* top of the stack */ |
49f531da |
21 | #ifdef OP_IN_REGISTER |
cb68f92d |
22 | PERLVAR(Topsave, OP *) |
49f531da |
23 | #else |
cb68f92d |
24 | PERLVAR(Top, OP *) /* currently executing op */ |
49f531da |
25 | #endif |
cb68f92d |
26 | PERLVAR(Tcurpad, SV **) /* active pad (lexicals+tmps) */ |
27 | |
28 | PERLVAR(Tstack_base, SV **) |
29 | PERLVAR(Tstack_max, SV **) |
30 | |
31 | PERLVAR(Tscopestack, I32 *) /* scopes we've ENTERed */ |
32 | PERLVAR(Tscopestack_ix, I32) |
33 | PERLVAR(Tscopestack_max,I32) |
49f531da |
34 | |
cb68f92d |
35 | PERLVAR(Tsavestack, ANY *) /* items that need to be restored |
36 | when LEAVEing scopes we've ENTERed */ |
37 | PERLVAR(Tsavestack_ix, I32) |
38 | PERLVAR(Tsavestack_max, I32) |
49f531da |
39 | |
cb68f92d |
40 | PERLVAR(Ttmps_stack, SV **) /* mortals we've made */ |
41 | PERLVARI(Ttmps_ix, I32, -1) |
42 | PERLVARI(Ttmps_floor, I32, -1) |
43 | PERLVAR(Ttmps_max, I32) |
49f531da |
44 | |
cb68f92d |
45 | PERLVAR(Tmarkstack, I32 *) /* stack_sp locations we're remembering */ |
46 | PERLVAR(Tmarkstack_ptr, I32 *) |
47 | PERLVAR(Tmarkstack_max, I32 *) |
49f531da |
48 | |
cb68f92d |
49 | PERLVAR(Tretstack, OP **) /* OPs we have postponed executing */ |
50 | PERLVAR(Tretstack_ix, I32) |
51 | PERLVAR(Tretstack_max, I32) |
49f531da |
52 | |
cb68f92d |
53 | PERLVAR(TSv, SV *) /* used to hold temporary values */ |
54 | PERLVAR(TXpv, XPV *) /* used to hold temporary values */ |
b099ddc0 |
55 | PERLVAR(Tna, STRLEN) /* for use in SvPV when length is |
56 | Not Applicable */ |
49f531da |
57 | |
5c0ca799 |
58 | /* stat stuff */ |
cb68f92d |
59 | PERLVAR(Tstatbuf, Stat_t) |
5c0ca799 |
60 | PERLVAR(Tstatcache, Stat_t) /* _ */ |
61 | PERLVAR(Tstatgv, GV *) |
62 | PERLVARI(Tstatname, SV *, Nullsv) |
63 | |
49f531da |
64 | #ifdef HAS_TIMES |
cb68f92d |
65 | PERLVAR(Ttimesbuf, struct tms) |
49f531da |
66 | #endif |
49f531da |
67 | |
68 | /* Fields used by magic variables such as $@, $/ and so on */ |
d4cce5f1 |
69 | PERLVAR(Ttainted, bool) /* using variables controlled by $< */ |
cb68f92d |
70 | PERLVAR(Tcurpm, PMOP *) /* what to do \ interps in REs from */ |
71 | PERLVAR(Tnrs, SV *) |
72 | PERLVAR(Trs, SV *) /* input record separator $/ */ |
73 | PERLVAR(Tlast_in_gv, GV *) /* GV used in last <FH> */ |
74 | PERLVAR(Tofs, char *) /* output field separator $, */ |
75 | PERLVAR(Tofslen, STRLEN) |
76 | PERLVAR(Tdefoutgv, GV *) /* default FH for output */ |
d4cce5f1 |
77 | PERLVARI(Tchopset, char *, " \n-") /* $: */ |
cb68f92d |
78 | PERLVAR(Tformtarget, SV *) |
79 | PERLVAR(Tbodytarget, SV *) |
80 | PERLVAR(Ttoptarget, SV *) |
49f531da |
81 | |
d4cce5f1 |
82 | /* Stashes */ |
83 | PERLVAR(Tdefstash, HV *) /* main symbol table */ |
84 | PERLVAR(Tcurstash, HV *) /* symbol table for current package */ |
49f531da |
85 | |
cb68f92d |
86 | PERLVAR(Trestartop, OP *) /* propagating an error from croak? */ |
3280af22 |
87 | PERLVARI(Tcurcop, COP * VOL, &PL_compiling) |
d4cce5f1 |
88 | PERLVAR(Tin_eval, VOL int) /* trap "fatal" errors? */ |
89 | PERLVAR(Tdelaymagic, int) /* ($<,$>) = ... */ |
24d3c518 |
90 | PERLVARI(Tdirty, bool, FALSE) /* in the middle of tearing things down? */ |
61bb5906 |
91 | PERLVAR(Tlocalizing, int) /* are we processing a local() list? */ |
49f531da |
92 | |
cb68f92d |
93 | PERLVAR(Tcurstack, AV *) /* THE STACK */ |
94 | PERLVAR(Tcurstackinfo, PERL_SI *) /* current stack + context */ |
95 | PERLVAR(Tmainstack, AV *) /* the stack when nothing funny is happening */ |
312caa8e |
96 | |
cb68f92d |
97 | PERLVAR(Ttop_env, JMPENV *) /* ptr. to current sigjmp() environment */ |
98 | PERLVAR(Tstart_env, JMPENV) /* empty startup sigjmp() environment */ |
312caa8e |
99 | PERLVARI(Tprotect, protect_proc_t, FUNC_NAME_TO_PTR(default_protect)) |
49f531da |
100 | |
4e4c362e |
101 | /* statics "owned" by various functions */ |
cb68f92d |
102 | PERLVAR(Tav_fetch_sv, SV *) /* owned by av_fetch() */ |
103 | PERLVAR(Thv_fetch_sv, SV *) /* owned by hv_fetch() */ |
104 | PERLVAR(Thv_fetch_ent_mh, HE) /* owned by hv_fetch_ent() */ |
105 | |
106 | PERLVAR(Tmodcount, I32) /* how much mod()ification in assignment? */ |
4e4c362e |
107 | |
5c0ca799 |
108 | PERLVAR(Tlastgotoprobe, OP*) /* from pp_ctl.c */ |
3967c732 |
109 | PERLVARI(Tdumpindent, I32, 4) /* # of blanks per dump indentation level */ |
5c0ca799 |
110 | |
111 | /* sort stuff */ |
112 | PERLVAR(Tsortcop, OP *) /* user defined sort routine */ |
113 | PERLVAR(Tsortstash, HV *) /* which is in some package or other */ |
114 | PERLVAR(Tfirstgv, GV *) /* $a */ |
115 | PERLVAR(Tsecondgv, GV *) /* $b */ |
116 | PERLVAR(Tsortcxix, I32) /* from pp_ctl.c */ |
117 | |
118 | /* regex stuff */ |
119 | |
120 | PERLVAR(Tscreamfirst, I32 *) |
121 | PERLVAR(Tscreamnext, I32 *) |
122 | PERLVARI(Tmaxscream, I32, -1) |
123 | PERLVAR(Tlastscream, SV *) |
124 | |
125 | PERLVAR(Tregdummy, regnode) /* from regcomp.c */ |
126 | PERLVAR(Tregcomp_parse, char*) /* Input-scan pointer. */ |
127 | PERLVAR(Tregxend, char*) /* End of input for compile */ |
128 | PERLVAR(Tregcode, regnode*) /* Code-emit pointer; ®dummy = don't */ |
129 | PERLVAR(Tregnaughty, I32) /* How bad is this pattern? */ |
130 | PERLVAR(Tregsawback, I32) /* Did we see \1, ...? */ |
131 | PERLVAR(Tregprecomp, char *) /* uncompiled string. */ |
132 | PERLVAR(Tregnpar, I32) /* () count. */ |
133 | PERLVAR(Tregsize, I32) /* Code size. */ |
134 | PERLVAR(Tregflags, U16) /* are we folding, multilining? */ |
135 | PERLVAR(Tregseen, U32) /* from regcomp.c */ |
136 | PERLVAR(Tseen_zerolen, I32) /* from regcomp.c */ |
137 | PERLVAR(Tseen_evals, I32) /* from regcomp.c */ |
138 | PERLVAR(Tregcomp_rx, regexp *) /* from regcomp.c */ |
139 | PERLVAR(Textralen, I32) /* from regcomp.c */ |
140 | PERLVAR(Tcolorset, int) /* from regcomp.c */ |
8d300b32 |
141 | PERLVAR(Tcolors[6], char *) /* from regcomp.c */ |
5c0ca799 |
142 | PERLVAR(Treginput, char *) /* String-input pointer. */ |
143 | PERLVAR(Tregbol, char *) /* Beginning of input, for ^ check. */ |
144 | PERLVAR(Tregeol, char *) /* End of input, for $ check. */ |
145 | PERLVAR(Tregstartp, char **) /* Pointer to startp array. */ |
146 | PERLVAR(Tregendp, char **) /* Ditto for endp. */ |
147 | PERLVAR(Treglastparen, U32 *) /* Similarly for lastparen. */ |
148 | PERLVAR(Tregtill, char *) /* How far we are required to go. */ |
149 | PERLVAR(Tregprev, char) /* char before regbol, \n if none */ |
150 | PERLVAR(Treg_start_tmp, char **) /* from regexec.c */ |
151 | PERLVAR(Treg_start_tmpl,U32) /* from regexec.c */ |
152 | PERLVAR(Tregdata, struct reg_data *) |
153 | /* from regexec.c renamed was data */ |
154 | PERLVAR(Tbostr, char *) /* from regexec.c */ |
155 | PERLVAR(Treg_flags, U32) /* from regexec.c */ |
156 | PERLVAR(Treg_eval_set, I32) /* from regexec.c */ |
157 | PERLVAR(Tregnarrate, I32) /* from regexec.c */ |
158 | PERLVAR(Tregprogram, regnode *) /* from regexec.c */ |
159 | PERLVARI(Tregindent, int, 0) /* from regexec.c */ |
160 | PERLVAR(Tregcc, CURCUR *) /* from regexec.c */ |
0f5d15d6 |
161 | PERLVAR(Treg_call_cc, struct re_cc_state *) /* from regexec.c */ |
162 | PERLVAR(Treg_re, regexp *) /* from regexec.c */ |
22e551b9 |
163 | PERLVAR(Treg_ganch, char *) /* position of \G */ |
164 | PERLVAR(Treg_sv, SV *) /* what we match against */ |
9661b544 |
165 | PERLVAR(Treg_magic, MAGIC *) /* pos-magic of what we match */ |
166 | PERLVAR(Treg_oldpos, I32) /* old pos of what we match */ |
5c5e4c24 |
167 | PERLVARI(Treg_oldcurpm, PMOP*, NULL) /* curpm before match */ |
168 | PERLVARI(Treg_curpm, PMOP*, NULL) /* curpm during match */ |
5c0ca799 |
169 | |
170 | PERLVARI(Tregcompp, regcomp_t, FUNC_NAME_TO_PTR(pregcomp)) |
171 | /* Pointer to RE compiler */ |
172 | PERLVARI(Tregexecp, regexec_t, FUNC_NAME_TO_PTR(regexec_flags)) |
173 | /* Pointer to RE executer */ |
57668c4d |
174 | PERLVARI(Treginterp_cnt,int, 0) /* Whether `Regexp' |
5c0ca799 |
175 | was interpolated. */ |
364723c2 |
176 | PERLVARI(Treg_starttry, char *, 0) /* -Dr: where regtry was called. */ |
22c35a8c |
177 | #ifdef DEBUGGING |
178 | PERLVARI(Twatchaddr, char **, 0) |
179 | PERLVAR(Twatchok, char *) |
180 | #endif |
d4cce5f1 |
181 | |
8b3be1d1 |
182 | /* Note that the variables below are all explicitly referenced in the code |
cb68f92d |
183 | * as thr->whatever and therefore don't need the 'T' prefix. */ |
8b3be1d1 |
184 | |
d4cce5f1 |
185 | #ifdef USE_THREADS |
49f531da |
186 | |
cb68f92d |
187 | PERLVAR(oursv, SV *) |
188 | PERLVAR(cvcache, HV *) |
189 | PERLVAR(self, perl_os_thread) /* Underlying thread object */ |
190 | PERLVAR(flags, U32) |
191 | PERLVAR(threadsv, AV *) /* Per-thread SVs ($_, $@ etc.) */ |
192 | PERLVAR(threadsvp, SV **) /* AvARRAY(threadsv) */ |
193 | PERLVAR(specific, AV *) /* Thread-specific user data */ |
194 | PERLVAR(errsv, SV *) /* Backing SV for $@ */ |
195 | PERLVAR(errhv, HV *) /* HV for what was %@ in pp_ctl.c */ |
196 | PERLVAR(mutex, perl_mutex) /* For the fields others can change */ |
197 | PERLVAR(tid, U32) |
49f531da |
198 | PERLVAR(prev, struct perl_thread *) |
cb68f92d |
199 | PERLVAR(next, struct perl_thread *) |
200 | /* Circular linked list of threads */ |
49f531da |
201 | |
202 | #ifdef HAVE_THREAD_INTERN |
cb68f92d |
203 | PERLVAR(i, struct thread_intern) |
204 | /* Platform-dependent internals */ |
49f531da |
205 | #endif |
206 | |
cb68f92d |
207 | PERLVAR(trailing_nul, char) /* For the sake of thrsv and oursv */ |
49f531da |
208 | |
d4cce5f1 |
209 | #endif /* USE_THREADS */ |