1 /***********************************************/
2 /* Global only to current thread */
3 /***********************************************/
5 /* Don't forget to re-run embed.pl to propagate changes! */
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.
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.
15 * Avoid build-specific #ifdefs here, like DEBUGGING. That way,
16 * we can keep binary compatibility of the curinterp structure */
18 /* Important ones in the first cache line (if alignment is done right) */
20 PERLVAR(Tstack_sp, SV **) /* top of the stack */
22 PERLVAR(Topsave, OP *)
24 PERLVAR(Top, OP *) /* currently executing op */
26 PERLVAR(Tcurpad, SV **) /* active pad (lexicals+tmps) */
28 PERLVAR(Tstack_base, SV **)
29 PERLVAR(Tstack_max, SV **)
31 PERLVAR(Tscopestack, I32 *) /* scopes we've ENTERed */
32 PERLVAR(Tscopestack_ix, I32)
33 PERLVAR(Tscopestack_max,I32)
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)
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)
45 PERLVAR(Tmarkstack, I32 *) /* stack_sp locations we're remembering */
46 PERLVAR(Tmarkstack_ptr, I32 *)
47 PERLVAR(Tmarkstack_max, I32 *)
49 PERLVAR(Tretstack, OP **) /* OPs we have postponed executing */
50 PERLVAR(Tretstack_ix, I32)
51 PERLVAR(Tretstack_max, I32)
53 PERLVAR(TSv, SV *) /* used to hold temporary values */
54 PERLVAR(TXpv, XPV *) /* used to hold temporary values */
56 PERLVAR(Tstatbuf, Stat_t)
58 PERLVAR(Ttimesbuf, struct tms)
61 /* Fields used by magic variables such as $@, $/ and so on */
62 PERLVAR(Ttainted, bool) /* using variables controlled by $< */
63 PERLVAR(Tcurpm, PMOP *) /* what to do \ interps in REs from */
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 */
70 PERLVARI(Tchopset, char *, " \n-") /* $: */
71 PERLVAR(Tformtarget, SV *)
72 PERLVAR(Tbodytarget, SV *)
73 PERLVAR(Ttoptarget, SV *)
76 PERLVAR(Tdefstash, HV *) /* main symbol table */
77 PERLVAR(Tcurstash, HV *) /* symbol table for current package */
79 PERLVAR(Trestartop, OP *) /* propagating an error from croak? */
80 PERLVARI(Tcurcop, COP * VOL, &compiling)
81 PERLVAR(Tin_eval, VOL int) /* trap "fatal" errors? */
82 PERLVAR(Tdelaymagic, int) /* ($<,$>) = ... */
83 PERLVAR(Tdirty, bool) /* in the middle of tearing things down? */
84 PERLVAR(Tlocalizing, int) /* are we processing a local() list? */
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 */
92 /* statics "owned" by various functions */
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() */
97 PERLVAR(Tmodcount, I32) /* how much mod()ification in assignment? */
99 /* XXX Sort stuff, firstgv secongv and so on? */
100 /* XXX What about regexp stuff? */
102 /* Note that the variables below are all explicitly referenced in the code
103 * as thr->whatever and therefore don't need the 'T' prefix. */
108 PERLVAR(cvcache, HV *)
109 PERLVAR(self, perl_os_thread) /* Underlying thread object */
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 */
118 PERLVAR(prev, struct perl_thread *)
119 PERLVAR(next, struct perl_thread *)
120 /* Circular linked list of threads */
122 #ifdef HAVE_THREAD_INTERN
123 PERLVAR(i, struct thread_intern)
124 /* Platform-dependent internals */
127 PERLVAR(trailing_nul, char) /* For the sake of thrsv and oursv */
129 #endif /* USE_THREADS */