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 */ |
96 | PERLVAR(Ttop_env, JMPENV *) /* ptr. to current sigjmp() environment */ |
97 | PERLVAR(Tstart_env, JMPENV) /* empty startup sigjmp() environment */ |
49f531da |
98 | |
4e4c362e |
99 | /* statics "owned" by various functions */ |
cb68f92d |
100 | PERLVAR(Tav_fetch_sv, SV *) /* owned by av_fetch() */ |
101 | PERLVAR(Thv_fetch_sv, SV *) /* owned by hv_fetch() */ |
102 | PERLVAR(Thv_fetch_ent_mh, HE) /* owned by hv_fetch_ent() */ |
103 | |
104 | PERLVAR(Tmodcount, I32) /* how much mod()ification in assignment? */ |
4e4c362e |
105 | |
5c0ca799 |
106 | PERLVAR(Tlastgotoprobe, OP*) /* from pp_ctl.c */ |
3967c732 |
107 | PERLVARI(Tdumpindent, I32, 4) /* # of blanks per dump indentation level */ |
5c0ca799 |
108 | |
109 | /* sort stuff */ |
110 | PERLVAR(Tsortcop, OP *) /* user defined sort routine */ |
111 | PERLVAR(Tsortstash, HV *) /* which is in some package or other */ |
112 | PERLVAR(Tfirstgv, GV *) /* $a */ |
113 | PERLVAR(Tsecondgv, GV *) /* $b */ |
114 | PERLVAR(Tsortcxix, I32) /* from pp_ctl.c */ |
115 | |
116 | /* regex stuff */ |
117 | |
118 | PERLVAR(Tscreamfirst, I32 *) |
119 | PERLVAR(Tscreamnext, I32 *) |
120 | PERLVARI(Tmaxscream, I32, -1) |
121 | PERLVAR(Tlastscream, SV *) |
122 | |
123 | PERLVAR(Tregdummy, regnode) /* from regcomp.c */ |
124 | PERLVAR(Tregcomp_parse, char*) /* Input-scan pointer. */ |
125 | PERLVAR(Tregxend, char*) /* End of input for compile */ |
126 | PERLVAR(Tregcode, regnode*) /* Code-emit pointer; ®dummy = don't */ |
127 | PERLVAR(Tregnaughty, I32) /* How bad is this pattern? */ |
128 | PERLVAR(Tregsawback, I32) /* Did we see \1, ...? */ |
129 | PERLVAR(Tregprecomp, char *) /* uncompiled string. */ |
130 | PERLVAR(Tregnpar, I32) /* () count. */ |
131 | PERLVAR(Tregsize, I32) /* Code size. */ |
132 | PERLVAR(Tregflags, U16) /* are we folding, multilining? */ |
133 | PERLVAR(Tregseen, U32) /* from regcomp.c */ |
134 | PERLVAR(Tseen_zerolen, I32) /* from regcomp.c */ |
135 | PERLVAR(Tseen_evals, I32) /* from regcomp.c */ |
136 | PERLVAR(Tregcomp_rx, regexp *) /* from regcomp.c */ |
137 | PERLVAR(Textralen, I32) /* from regcomp.c */ |
138 | PERLVAR(Tcolorset, int) /* from regcomp.c */ |
8d300b32 |
139 | PERLVAR(Tcolors[6], char *) /* from regcomp.c */ |
5c0ca799 |
140 | PERLVAR(Treginput, char *) /* String-input pointer. */ |
141 | PERLVAR(Tregbol, char *) /* Beginning of input, for ^ check. */ |
142 | PERLVAR(Tregeol, char *) /* End of input, for $ check. */ |
143 | PERLVAR(Tregstartp, char **) /* Pointer to startp array. */ |
144 | PERLVAR(Tregendp, char **) /* Ditto for endp. */ |
145 | PERLVAR(Treglastparen, U32 *) /* Similarly for lastparen. */ |
146 | PERLVAR(Tregtill, char *) /* How far we are required to go. */ |
147 | PERLVAR(Tregprev, char) /* char before regbol, \n if none */ |
148 | PERLVAR(Treg_start_tmp, char **) /* from regexec.c */ |
149 | PERLVAR(Treg_start_tmpl,U32) /* from regexec.c */ |
150 | PERLVAR(Tregdata, struct reg_data *) |
151 | /* from regexec.c renamed was data */ |
152 | PERLVAR(Tbostr, char *) /* from regexec.c */ |
153 | PERLVAR(Treg_flags, U32) /* from regexec.c */ |
154 | PERLVAR(Treg_eval_set, I32) /* from regexec.c */ |
155 | PERLVAR(Tregnarrate, I32) /* from regexec.c */ |
156 | PERLVAR(Tregprogram, regnode *) /* from regexec.c */ |
157 | PERLVARI(Tregindent, int, 0) /* from regexec.c */ |
158 | PERLVAR(Tregcc, CURCUR *) /* from regexec.c */ |
0f5d15d6 |
159 | PERLVAR(Treg_call_cc, struct re_cc_state *) /* from regexec.c */ |
160 | PERLVAR(Treg_re, regexp *) /* from regexec.c */ |
22e551b9 |
161 | PERLVAR(Treg_ganch, char *) /* position of \G */ |
162 | PERLVAR(Treg_sv, SV *) /* what we match against */ |
9661b544 |
163 | PERLVAR(Treg_magic, MAGIC *) /* pos-magic of what we match */ |
164 | PERLVAR(Treg_oldpos, I32) /* old pos of what we match */ |
5c5e4c24 |
165 | PERLVARI(Treg_oldcurpm, PMOP*, NULL) /* curpm before match */ |
166 | PERLVARI(Treg_curpm, PMOP*, NULL) /* curpm during match */ |
5c0ca799 |
167 | |
168 | PERLVARI(Tregcompp, regcomp_t, FUNC_NAME_TO_PTR(pregcomp)) |
169 | /* Pointer to RE compiler */ |
170 | PERLVARI(Tregexecp, regexec_t, FUNC_NAME_TO_PTR(regexec_flags)) |
171 | /* Pointer to RE executer */ |
57668c4d |
172 | PERLVARI(Treginterp_cnt,int, 0) /* Whether `Regexp' |
5c0ca799 |
173 | was interpolated. */ |
364723c2 |
174 | PERLVARI(Treg_starttry, char *, 0) /* -Dr: where regtry was called. */ |
22c35a8c |
175 | #ifdef DEBUGGING |
176 | PERLVARI(Twatchaddr, char **, 0) |
177 | PERLVAR(Twatchok, char *) |
178 | #endif |
d4cce5f1 |
179 | |
8b3be1d1 |
180 | /* Note that the variables below are all explicitly referenced in the code |
cb68f92d |
181 | * as thr->whatever and therefore don't need the 'T' prefix. */ |
8b3be1d1 |
182 | |
d4cce5f1 |
183 | #ifdef USE_THREADS |
49f531da |
184 | |
cb68f92d |
185 | PERLVAR(oursv, SV *) |
186 | PERLVAR(cvcache, HV *) |
187 | PERLVAR(self, perl_os_thread) /* Underlying thread object */ |
188 | PERLVAR(flags, U32) |
189 | PERLVAR(threadsv, AV *) /* Per-thread SVs ($_, $@ etc.) */ |
190 | PERLVAR(threadsvp, SV **) /* AvARRAY(threadsv) */ |
191 | PERLVAR(specific, AV *) /* Thread-specific user data */ |
192 | PERLVAR(errsv, SV *) /* Backing SV for $@ */ |
193 | PERLVAR(errhv, HV *) /* HV for what was %@ in pp_ctl.c */ |
194 | PERLVAR(mutex, perl_mutex) /* For the fields others can change */ |
195 | PERLVAR(tid, U32) |
49f531da |
196 | PERLVAR(prev, struct perl_thread *) |
cb68f92d |
197 | PERLVAR(next, struct perl_thread *) |
198 | /* Circular linked list of threads */ |
49f531da |
199 | |
200 | #ifdef HAVE_THREAD_INTERN |
cb68f92d |
201 | PERLVAR(i, struct thread_intern) |
202 | /* Platform-dependent internals */ |
49f531da |
203 | #endif |
204 | |
cb68f92d |
205 | PERLVAR(trailing_nul, char) /* For the sake of thrsv and oursv */ |
49f531da |
206 | |
d4cce5f1 |
207 | #endif /* USE_THREADS */ |