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 | |
cb68f92d | 56 | PERLVAR(Tstatbuf, Stat_t) |
49f531da | 57 | #ifdef HAS_TIMES |
cb68f92d | 58 | PERLVAR(Ttimesbuf, struct tms) |
49f531da | 59 | #endif |
49f531da NIS |
60 | |
61 | /* Fields used by magic variables such as $@, $/ and so on */ | |
d4cce5f1 | 62 | PERLVAR(Ttainted, bool) /* using variables controlled by $< */ |
cb68f92d GS |
63 | PERLVAR(Tcurpm, PMOP *) /* what to do \ interps in REs from */ |
64 | PERLVAR(Tnrs, SV *) | |
65 | PERLVAR(Trs, SV *) /* input record separator $/ */ | |
66 | PERLVAR(Tlast_in_gv, GV *) /* GV used in last <FH> */ | |
67 | PERLVAR(Tofs, char *) /* output field separator $, */ | |
68 | PERLVAR(Tofslen, STRLEN) | |
69 | PERLVAR(Tdefoutgv, GV *) /* default FH for output */ | |
d4cce5f1 | 70 | PERLVARI(Tchopset, char *, " \n-") /* $: */ |
cb68f92d GS |
71 | PERLVAR(Tformtarget, SV *) |
72 | PERLVAR(Tbodytarget, SV *) | |
73 | PERLVAR(Ttoptarget, SV *) | |
49f531da | 74 | |
d4cce5f1 NIS |
75 | /* Stashes */ |
76 | PERLVAR(Tdefstash, HV *) /* main symbol table */ | |
77 | PERLVAR(Tcurstash, HV *) /* symbol table for current package */ | |
49f531da | 78 | |
cb68f92d GS |
79 | PERLVAR(Trestartop, OP *) /* propagating an error from croak? */ |
80 | PERLVARI(Tcurcop, COP * VOL, &compiling) | |
d4cce5f1 NIS |
81 | PERLVAR(Tin_eval, VOL int) /* trap "fatal" errors? */ |
82 | PERLVAR(Tdelaymagic, int) /* ($<,$>) = ... */ | |
cb68f92d | 83 | PERLVAR(Tdirty, bool) /* in the middle of tearing things down? */ |
61bb5906 | 84 | PERLVAR(Tlocalizing, int) /* are we processing a local() list? */ |
49f531da | 85 | |
cb68f92d GS |
86 | PERLVAR(Tcurstack, AV *) /* THE STACK */ |
87 | PERLVAR(Tcurstackinfo, PERL_SI *) /* current stack + context */ | |
88 | PERLVAR(Tmainstack, AV *) /* the stack when nothing funny is happening */ | |
89 | PERLVAR(Ttop_env, JMPENV *) /* ptr. to current sigjmp() environment */ | |
90 | PERLVAR(Tstart_env, JMPENV) /* empty startup sigjmp() environment */ | |
49f531da | 91 | |
4e4c362e | 92 | /* statics "owned" by various functions */ |
cb68f92d GS |
93 | PERLVAR(Tav_fetch_sv, SV *) /* owned by av_fetch() */ |
94 | PERLVAR(Thv_fetch_sv, SV *) /* owned by hv_fetch() */ | |
95 | PERLVAR(Thv_fetch_ent_mh, HE) /* owned by hv_fetch_ent() */ | |
96 | ||
97 | PERLVAR(Tmodcount, I32) /* how much mod()ification in assignment? */ | |
4e4c362e | 98 | |
49f531da | 99 | /* XXX Sort stuff, firstgv secongv and so on? */ |
d4cce5f1 NIS |
100 | /* XXX What about regexp stuff? */ |
101 | ||
8b3be1d1 | 102 | /* Note that the variables below are all explicitly referenced in the code |
cb68f92d | 103 | * as thr->whatever and therefore don't need the 'T' prefix. */ |
8b3be1d1 | 104 | |
d4cce5f1 | 105 | #ifdef USE_THREADS |
49f531da | 106 | |
cb68f92d GS |
107 | PERLVAR(oursv, SV *) |
108 | PERLVAR(cvcache, HV *) | |
109 | PERLVAR(self, perl_os_thread) /* Underlying thread object */ | |
110 | PERLVAR(flags, U32) | |
111 | PERLVAR(threadsv, AV *) /* Per-thread SVs ($_, $@ etc.) */ | |
112 | PERLVAR(threadsvp, SV **) /* AvARRAY(threadsv) */ | |
113 | PERLVAR(specific, AV *) /* Thread-specific user data */ | |
114 | PERLVAR(errsv, SV *) /* Backing SV for $@ */ | |
115 | PERLVAR(errhv, HV *) /* HV for what was %@ in pp_ctl.c */ | |
116 | PERLVAR(mutex, perl_mutex) /* For the fields others can change */ | |
117 | PERLVAR(tid, U32) | |
49f531da | 118 | PERLVAR(prev, struct perl_thread *) |
cb68f92d GS |
119 | PERLVAR(next, struct perl_thread *) |
120 | /* Circular linked list of threads */ | |
49f531da NIS |
121 | |
122 | #ifdef HAVE_THREAD_INTERN | |
cb68f92d GS |
123 | PERLVAR(i, struct thread_intern) |
124 | /* Platform-dependent internals */ | |
49f531da NIS |
125 | #endif |
126 | ||
cb68f92d | 127 | PERLVAR(trailing_nul, char) /* For the sake of thrsv and oursv */ |
49f531da | 128 | |
d4cce5f1 | 129 | #endif /* USE_THREADS */ |