This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re: perlbug doesn't check that save succeeded
[perl5.git] / thrdvar.h
CommitLineData
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 20PERLVAR(Tstack_sp, SV **) /* top of the stack */
49f531da 21#ifdef OP_IN_REGISTER
cb68f92d 22PERLVAR(Topsave, OP *)
49f531da 23#else
cb68f92d 24PERLVAR(Top, OP *) /* currently executing op */
49f531da 25#endif
cb68f92d
GS
26PERLVAR(Tcurpad, SV **) /* active pad (lexicals+tmps) */
27
28PERLVAR(Tstack_base, SV **)
29PERLVAR(Tstack_max, SV **)
30
31PERLVAR(Tscopestack, I32 *) /* scopes we've ENTERed */
32PERLVAR(Tscopestack_ix, I32)
33PERLVAR(Tscopestack_max,I32)
49f531da 34
cb68f92d
GS
35PERLVAR(Tsavestack, ANY *) /* items that need to be restored
36 when LEAVEing scopes we've ENTERed */
37PERLVAR(Tsavestack_ix, I32)
38PERLVAR(Tsavestack_max, I32)
49f531da 39
cb68f92d
GS
40PERLVAR(Ttmps_stack, SV **) /* mortals we've made */
41PERLVARI(Ttmps_ix, I32, -1)
42PERLVARI(Ttmps_floor, I32, -1)
43PERLVAR(Ttmps_max, I32)
49f531da 44
cb68f92d
GS
45PERLVAR(Tmarkstack, I32 *) /* stack_sp locations we're remembering */
46PERLVAR(Tmarkstack_ptr, I32 *)
47PERLVAR(Tmarkstack_max, I32 *)
49f531da 48
cb68f92d
GS
49PERLVAR(Tretstack, OP **) /* OPs we have postponed executing */
50PERLVAR(Tretstack_ix, I32)
51PERLVAR(Tretstack_max, I32)
49f531da 52
cb68f92d
GS
53PERLVAR(TSv, SV *) /* used to hold temporary values */
54PERLVAR(TXpv, XPV *) /* used to hold temporary values */
49f531da 55
cb68f92d 56PERLVAR(Tstatbuf, Stat_t)
49f531da 57#ifdef HAS_TIMES
cb68f92d 58PERLVAR(Ttimesbuf, struct tms)
49f531da 59#endif
49f531da
NIS
60
61/* Fields used by magic variables such as $@, $/ and so on */
d4cce5f1 62PERLVAR(Ttainted, bool) /* using variables controlled by $< */
cb68f92d
GS
63PERLVAR(Tcurpm, PMOP *) /* what to do \ interps in REs from */
64PERLVAR(Tnrs, SV *)
65PERLVAR(Trs, SV *) /* input record separator $/ */
66PERLVAR(Tlast_in_gv, GV *) /* GV used in last <FH> */
67PERLVAR(Tofs, char *) /* output field separator $, */
68PERLVAR(Tofslen, STRLEN)
69PERLVAR(Tdefoutgv, GV *) /* default FH for output */
d4cce5f1 70PERLVARI(Tchopset, char *, " \n-") /* $: */
cb68f92d
GS
71PERLVAR(Tformtarget, SV *)
72PERLVAR(Tbodytarget, SV *)
73PERLVAR(Ttoptarget, SV *)
49f531da 74
d4cce5f1
NIS
75/* Stashes */
76PERLVAR(Tdefstash, HV *) /* main symbol table */
77PERLVAR(Tcurstash, HV *) /* symbol table for current package */
49f531da 78
cb68f92d
GS
79PERLVAR(Trestartop, OP *) /* propagating an error from croak? */
80PERLVARI(Tcurcop, COP * VOL, &compiling)
d4cce5f1
NIS
81PERLVAR(Tin_eval, VOL int) /* trap "fatal" errors? */
82PERLVAR(Tdelaymagic, int) /* ($<,$>) = ... */
cb68f92d 83PERLVAR(Tdirty, bool) /* in the middle of tearing things down? */
61bb5906 84PERLVAR(Tlocalizing, int) /* are we processing a local() list? */
49f531da 85
cb68f92d
GS
86PERLVAR(Tcurstack, AV *) /* THE STACK */
87PERLVAR(Tcurstackinfo, PERL_SI *) /* current stack + context */
88PERLVAR(Tmainstack, AV *) /* the stack when nothing funny is happening */
89PERLVAR(Ttop_env, JMPENV *) /* ptr. to current sigjmp() environment */
90PERLVAR(Tstart_env, JMPENV) /* empty startup sigjmp() environment */
49f531da 91
4e4c362e 92/* statics "owned" by various functions */
cb68f92d
GS
93PERLVAR(Tav_fetch_sv, SV *) /* owned by av_fetch() */
94PERLVAR(Thv_fetch_sv, SV *) /* owned by hv_fetch() */
95PERLVAR(Thv_fetch_ent_mh, HE) /* owned by hv_fetch_ent() */
96
97PERLVAR(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
107PERLVAR(oursv, SV *)
108PERLVAR(cvcache, HV *)
109PERLVAR(self, perl_os_thread) /* Underlying thread object */
110PERLVAR(flags, U32)
111PERLVAR(threadsv, AV *) /* Per-thread SVs ($_, $@ etc.) */
112PERLVAR(threadsvp, SV **) /* AvARRAY(threadsv) */
113PERLVAR(specific, AV *) /* Thread-specific user data */
114PERLVAR(errsv, SV *) /* Backing SV for $@ */
115PERLVAR(errhv, HV *) /* HV for what was %@ in pp_ctl.c */
116PERLVAR(mutex, perl_mutex) /* For the fields others can change */
117PERLVAR(tid, U32)
49f531da 118PERLVAR(prev, struct perl_thread *)
cb68f92d
GS
119PERLVAR(next, struct perl_thread *)
120 /* Circular linked list of threads */
49f531da
NIS
121
122#ifdef HAVE_THREAD_INTERN
cb68f92d
GS
123PERLVAR(i, struct thread_intern)
124 /* Platform-dependent internals */
49f531da
NIS
125#endif
126
cb68f92d 127PERLVAR(trailing_nul, char) /* For the sake of thrsv and oursv */
49f531da 128
d4cce5f1 129#endif /* USE_THREADS */