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 */ | |
49f531da | 55 | |
5c0ca799 | 56 | /* stat stuff */ |
cb68f92d | 57 | PERLVAR(Tstatbuf, Stat_t) |
5c0ca799 GS |
58 | PERLVAR(Tstatcache, Stat_t) /* _ */ |
59 | PERLVAR(Tstatgv, GV *) | |
60 | PERLVARI(Tstatname, SV *, Nullsv) | |
61 | ||
49f531da | 62 | #ifdef HAS_TIMES |
cb68f92d | 63 | PERLVAR(Ttimesbuf, struct tms) |
49f531da | 64 | #endif |
49f531da NIS |
65 | |
66 | /* Fields used by magic variables such as $@, $/ and so on */ | |
d4cce5f1 | 67 | PERLVAR(Ttainted, bool) /* using variables controlled by $< */ |
cb68f92d GS |
68 | PERLVAR(Tcurpm, PMOP *) /* what to do \ interps in REs from */ |
69 | PERLVAR(Tnrs, SV *) | |
70 | PERLVAR(Trs, SV *) /* input record separator $/ */ | |
71 | PERLVAR(Tlast_in_gv, GV *) /* GV used in last <FH> */ | |
72 | PERLVAR(Tofs, char *) /* output field separator $, */ | |
73 | PERLVAR(Tofslen, STRLEN) | |
74 | PERLVAR(Tdefoutgv, GV *) /* default FH for output */ | |
d4cce5f1 | 75 | PERLVARI(Tchopset, char *, " \n-") /* $: */ |
cb68f92d GS |
76 | PERLVAR(Tformtarget, SV *) |
77 | PERLVAR(Tbodytarget, SV *) | |
78 | PERLVAR(Ttoptarget, SV *) | |
49f531da | 79 | |
d4cce5f1 NIS |
80 | /* Stashes */ |
81 | PERLVAR(Tdefstash, HV *) /* main symbol table */ | |
82 | PERLVAR(Tcurstash, HV *) /* symbol table for current package */ | |
49f531da | 83 | |
cb68f92d | 84 | PERLVAR(Trestartop, OP *) /* propagating an error from croak? */ |
3280af22 | 85 | PERLVARI(Tcurcop, COP * VOL, &PL_compiling) |
d4cce5f1 NIS |
86 | PERLVAR(Tin_eval, VOL int) /* trap "fatal" errors? */ |
87 | PERLVAR(Tdelaymagic, int) /* ($<,$>) = ... */ | |
cb68f92d | 88 | PERLVAR(Tdirty, bool) /* in the middle of tearing things down? */ |
61bb5906 | 89 | PERLVAR(Tlocalizing, int) /* are we processing a local() list? */ |
49f531da | 90 | |
cb68f92d GS |
91 | PERLVAR(Tcurstack, AV *) /* THE STACK */ |
92 | PERLVAR(Tcurstackinfo, PERL_SI *) /* current stack + context */ | |
93 | PERLVAR(Tmainstack, AV *) /* the stack when nothing funny is happening */ | |
94 | PERLVAR(Ttop_env, JMPENV *) /* ptr. to current sigjmp() environment */ | |
95 | PERLVAR(Tstart_env, JMPENV) /* empty startup sigjmp() environment */ | |
49f531da | 96 | |
4e4c362e | 97 | /* statics "owned" by various functions */ |
cb68f92d GS |
98 | PERLVAR(Tav_fetch_sv, SV *) /* owned by av_fetch() */ |
99 | PERLVAR(Thv_fetch_sv, SV *) /* owned by hv_fetch() */ | |
100 | PERLVAR(Thv_fetch_ent_mh, HE) /* owned by hv_fetch_ent() */ | |
101 | ||
102 | PERLVAR(Tmodcount, I32) /* how much mod()ification in assignment? */ | |
4e4c362e | 103 | |
5c0ca799 GS |
104 | PERLVAR(Tlastgotoprobe, OP*) /* from pp_ctl.c */ |
105 | ||
106 | /* sort stuff */ | |
107 | PERLVAR(Tsortcop, OP *) /* user defined sort routine */ | |
108 | PERLVAR(Tsortstash, HV *) /* which is in some package or other */ | |
109 | PERLVAR(Tfirstgv, GV *) /* $a */ | |
110 | PERLVAR(Tsecondgv, GV *) /* $b */ | |
111 | PERLVAR(Tsortcxix, I32) /* from pp_ctl.c */ | |
112 | ||
113 | /* regex stuff */ | |
114 | ||
115 | PERLVAR(Tscreamfirst, I32 *) | |
116 | PERLVAR(Tscreamnext, I32 *) | |
117 | PERLVARI(Tmaxscream, I32, -1) | |
118 | PERLVAR(Tlastscream, SV *) | |
119 | ||
120 | PERLVAR(Tregdummy, regnode) /* from regcomp.c */ | |
121 | PERLVAR(Tregcomp_parse, char*) /* Input-scan pointer. */ | |
122 | PERLVAR(Tregxend, char*) /* End of input for compile */ | |
123 | PERLVAR(Tregcode, regnode*) /* Code-emit pointer; ®dummy = don't */ | |
124 | PERLVAR(Tregnaughty, I32) /* How bad is this pattern? */ | |
125 | PERLVAR(Tregsawback, I32) /* Did we see \1, ...? */ | |
126 | PERLVAR(Tregprecomp, char *) /* uncompiled string. */ | |
127 | PERLVAR(Tregnpar, I32) /* () count. */ | |
128 | PERLVAR(Tregsize, I32) /* Code size. */ | |
129 | PERLVAR(Tregflags, U16) /* are we folding, multilining? */ | |
130 | PERLVAR(Tregseen, U32) /* from regcomp.c */ | |
131 | PERLVAR(Tseen_zerolen, I32) /* from regcomp.c */ | |
132 | PERLVAR(Tseen_evals, I32) /* from regcomp.c */ | |
133 | PERLVAR(Tregcomp_rx, regexp *) /* from regcomp.c */ | |
134 | PERLVAR(Textralen, I32) /* from regcomp.c */ | |
135 | PERLVAR(Tcolorset, int) /* from regcomp.c */ | |
8d300b32 | 136 | PERLVAR(Tcolors[6], char *) /* from regcomp.c */ |
5c0ca799 GS |
137 | PERLVAR(Treginput, char *) /* String-input pointer. */ |
138 | PERLVAR(Tregbol, char *) /* Beginning of input, for ^ check. */ | |
139 | PERLVAR(Tregeol, char *) /* End of input, for $ check. */ | |
140 | PERLVAR(Tregstartp, char **) /* Pointer to startp array. */ | |
141 | PERLVAR(Tregendp, char **) /* Ditto for endp. */ | |
142 | PERLVAR(Treglastparen, U32 *) /* Similarly for lastparen. */ | |
143 | PERLVAR(Tregtill, char *) /* How far we are required to go. */ | |
144 | PERLVAR(Tregprev, char) /* char before regbol, \n if none */ | |
145 | PERLVAR(Treg_start_tmp, char **) /* from regexec.c */ | |
146 | PERLVAR(Treg_start_tmpl,U32) /* from regexec.c */ | |
147 | PERLVAR(Tregdata, struct reg_data *) | |
148 | /* from regexec.c renamed was data */ | |
149 | PERLVAR(Tbostr, char *) /* from regexec.c */ | |
150 | PERLVAR(Treg_flags, U32) /* from regexec.c */ | |
151 | PERLVAR(Treg_eval_set, I32) /* from regexec.c */ | |
152 | PERLVAR(Tregnarrate, I32) /* from regexec.c */ | |
153 | PERLVAR(Tregprogram, regnode *) /* from regexec.c */ | |
154 | PERLVARI(Tregindent, int, 0) /* from regexec.c */ | |
155 | PERLVAR(Tregcc, CURCUR *) /* from regexec.c */ | |
0f5d15d6 IZ |
156 | PERLVAR(Treg_call_cc, struct re_cc_state *) /* from regexec.c */ |
157 | PERLVAR(Treg_re, regexp *) /* from regexec.c */ | |
5c0ca799 GS |
158 | |
159 | PERLVARI(Tregcompp, regcomp_t, FUNC_NAME_TO_PTR(pregcomp)) | |
160 | /* Pointer to RE compiler */ | |
161 | PERLVARI(Tregexecp, regexec_t, FUNC_NAME_TO_PTR(regexec_flags)) | |
162 | /* Pointer to RE executer */ | |
163 | PERLVARI(Treginterp_cnt,int, 0) /* Whether `Regexp' | |
164 | was interpolated. */ | |
165 | ||
d4cce5f1 | 166 | |
8b3be1d1 | 167 | /* Note that the variables below are all explicitly referenced in the code |
cb68f92d | 168 | * as thr->whatever and therefore don't need the 'T' prefix. */ |
8b3be1d1 | 169 | |
d4cce5f1 | 170 | #ifdef USE_THREADS |
49f531da | 171 | |
cb68f92d GS |
172 | PERLVAR(oursv, SV *) |
173 | PERLVAR(cvcache, HV *) | |
174 | PERLVAR(self, perl_os_thread) /* Underlying thread object */ | |
175 | PERLVAR(flags, U32) | |
176 | PERLVAR(threadsv, AV *) /* Per-thread SVs ($_, $@ etc.) */ | |
177 | PERLVAR(threadsvp, SV **) /* AvARRAY(threadsv) */ | |
178 | PERLVAR(specific, AV *) /* Thread-specific user data */ | |
179 | PERLVAR(errsv, SV *) /* Backing SV for $@ */ | |
180 | PERLVAR(errhv, HV *) /* HV for what was %@ in pp_ctl.c */ | |
181 | PERLVAR(mutex, perl_mutex) /* For the fields others can change */ | |
182 | PERLVAR(tid, U32) | |
49f531da | 183 | PERLVAR(prev, struct perl_thread *) |
cb68f92d GS |
184 | PERLVAR(next, struct perl_thread *) |
185 | /* Circular linked list of threads */ | |
49f531da NIS |
186 | |
187 | #ifdef HAVE_THREAD_INTERN | |
cb68f92d GS |
188 | PERLVAR(i, struct thread_intern) |
189 | /* Platform-dependent internals */ | |
49f531da NIS |
190 | #endif |
191 | ||
cb68f92d | 192 | PERLVAR(trailing_nul, char) /* For the sake of thrsv and oursv */ |
49f531da | 193 | |
d4cce5f1 | 194 | #endif /* USE_THREADS */ |