Commit | Line | Data |
---|---|---|
cb68f92d GS |
1 | /***********************************************/ |
2 | /* Global only to current thread */ | |
3 | /***********************************************/ | |
4 | ||
8b3be1d1 JP |
5 | /* Don't forget to re-run embed.pl to propagate changes! */ |
6 | ||
cb68f92d GS |
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 GS |
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 GS |
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 GS |
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 GS |
45 | PERLVAR(Tmarkstack, I32 *) /* stack_sp locations we're remembering */ |
46 | PERLVAR(Tmarkstack_ptr, I32 *) | |
47 | PERLVAR(Tmarkstack_max, I32 *) | |
49f531da | 48 | |
cb68f92d GS |
49 | PERLVAR(Tretstack, OP **) /* OPs we have postponed executing */ |
50 | PERLVAR(Tretstack_ix, I32) | |
51 | PERLVAR(Tretstack_max, I32) | |
49f531da | 52 | |
cb68f92d GS |
53 | PERLVAR(TSv, SV *) /* used to hold temporary values */ |
54 | PERLVAR(TXpv, XPV *) /* used to hold temporary values */ | |
b099ddc0 GS |
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 GS |
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 NIS |
67 | |
68 | /* Fields used by magic variables such as $@, $/ and so on */ | |
d4cce5f1 | 69 | PERLVAR(Ttainted, bool) /* using variables controlled by $< */ |
cb68f92d GS |
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 GS |
78 | PERLVAR(Tformtarget, SV *) |
79 | PERLVAR(Tbodytarget, SV *) | |
80 | PERLVAR(Ttoptarget, SV *) | |
49f531da | 81 | |
d4cce5f1 NIS |
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 NIS |
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 GS |
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 GS |
97 | PERLVAR(Ttop_env, JMPENV *) /* ptr. to current sigjmp() environment */ |
98 | PERLVAR(Tstart_env, JMPENV) /* empty startup sigjmp() environment */ | |
cea2e8a9 | 99 | PERLVARI(Tprotect, protect_proc_t, FUNC_NAME_TO_PTR(Perl_default_protect)) |
49f531da | 100 | |
4e4c362e | 101 | /* statics "owned" by various functions */ |
cb68f92d GS |
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 GS |
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 GS |
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. */ | |
cf93c79d IZ |
145 | PERLVAR(Tregstartp, I32 *) /* Pointer to startp array. */ |
146 | PERLVAR(Tregendp, I32 *) /* Ditto for endp. */ | |
5c0ca799 GS |
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 IZ |
161 | PERLVAR(Treg_call_cc, struct re_cc_state *) /* from regexec.c */ |
162 | PERLVAR(Treg_re, regexp *) /* from regexec.c */ | |
22e551b9 IZ |
163 | PERLVAR(Treg_ganch, char *) /* position of \G */ |
164 | PERLVAR(Treg_sv, SV *) /* what we match against */ | |
9661b544 IZ |
165 | PERLVAR(Treg_magic, MAGIC *) /* pos-magic of what we match */ |
166 | PERLVAR(Treg_oldpos, I32) /* old pos of what we match */ | |
5c5e4c24 IZ |
167 | PERLVARI(Treg_oldcurpm, PMOP*, NULL) /* curpm before match */ |
168 | PERLVARI(Treg_curpm, PMOP*, NULL) /* curpm during match */ | |
cf93c79d IZ |
169 | PERLVAR(Treg_oldsaved, char*) /* old saved substr during match */ |
170 | PERLVAR(Treg_oldsavedlen, STRLEN) /* old length of saved substr during match */ | |
5c0ca799 | 171 | |
cea2e8a9 | 172 | PERLVARI(Tregcompp, regcomp_t, FUNC_NAME_TO_PTR(Perl_pregcomp)) |
f722798b | 173 | /* Pointer to REx compiler */ |
cea2e8a9 | 174 | PERLVARI(Tregexecp, regexec_t, FUNC_NAME_TO_PTR(Perl_regexec_flags)) |
f722798b IZ |
175 | /* Pointer to REx executer */ |
176 | PERLVARI(Tregint_start, re_intuit_start_t, FUNC_NAME_TO_PTR(Perl_re_intuit_start)) | |
177 | /* Pointer to optimized REx executer */ | |
178 | PERLVARI(Tregint_string,re_intuit_string_t, FUNC_NAME_TO_PTR(Perl_re_intuit_string)) | |
179 | /* Pointer to optimized REx string */ | |
180 | PERLVARI(Tregfree, regfree_t, FUNC_NAME_TO_PTR(Perl_pregfree)) | |
181 | /* Pointer to REx free()er */ | |
182 | ||
57668c4d | 183 | PERLVARI(Treginterp_cnt,int, 0) /* Whether `Regexp' |
5c0ca799 | 184 | was interpolated. */ |
364723c2 | 185 | PERLVARI(Treg_starttry, char *, 0) /* -Dr: where regtry was called. */ |
22c35a8c GS |
186 | #ifdef DEBUGGING |
187 | PERLVARI(Twatchaddr, char **, 0) | |
188 | PERLVAR(Twatchok, char *) | |
189 | #endif | |
d4cce5f1 | 190 | |
8b3be1d1 | 191 | /* Note that the variables below are all explicitly referenced in the code |
cb68f92d | 192 | * as thr->whatever and therefore don't need the 'T' prefix. */ |
8b3be1d1 | 193 | |
d4cce5f1 | 194 | #ifdef USE_THREADS |
49f531da | 195 | |
cb68f92d GS |
196 | PERLVAR(oursv, SV *) |
197 | PERLVAR(cvcache, HV *) | |
198 | PERLVAR(self, perl_os_thread) /* Underlying thread object */ | |
199 | PERLVAR(flags, U32) | |
200 | PERLVAR(threadsv, AV *) /* Per-thread SVs ($_, $@ etc.) */ | |
201 | PERLVAR(threadsvp, SV **) /* AvARRAY(threadsv) */ | |
202 | PERLVAR(specific, AV *) /* Thread-specific user data */ | |
203 | PERLVAR(errsv, SV *) /* Backing SV for $@ */ | |
204 | PERLVAR(errhv, HV *) /* HV for what was %@ in pp_ctl.c */ | |
205 | PERLVAR(mutex, perl_mutex) /* For the fields others can change */ | |
206 | PERLVAR(tid, U32) | |
49f531da | 207 | PERLVAR(prev, struct perl_thread *) |
cb68f92d GS |
208 | PERLVAR(next, struct perl_thread *) |
209 | /* Circular linked list of threads */ | |
49f531da NIS |
210 | |
211 | #ifdef HAVE_THREAD_INTERN | |
cb68f92d GS |
212 | PERLVAR(i, struct thread_intern) |
213 | /* Platform-dependent internals */ | |
49f531da NIS |
214 | #endif |
215 | ||
cb68f92d | 216 | PERLVAR(trailing_nul, char) /* For the sake of thrsv and oursv */ |
49f531da | 217 | |
d4cce5f1 | 218 | #endif /* USE_THREADS */ |