This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Globals and structs via macros - part 1 of N
[perl5.git] / thrdvar.h
CommitLineData
49f531da
NIS
1/* Per-thread variables */
2/* Important ones in the first cache line (if alignment is done right) */
3PERLVAR(Tstack_sp, SV **)
4#ifdef OP_IN_REGISTER
5PERLVAR(Topsave, OP *)
6#else
7PERLVAR(Top, OP *)
8#endif
9PERLVAR(Tcurpad, SV **)
10PERLVAR(Tstack_base, SV **)
11
12PERLVAR(Tstack_max, SV **)
13
14PERLVAR(Tscopestack, I32 *)
15PERLVAR(Tscopestack_ix, I32)
16PERLVAR(Tscopestack_max,I32)
17
18PERLVAR(Tsavestack, ANY *)
19PERLVAR(Tsavestack_ix, I32)
20PERLVAR(Tsavestack_max, I32)
21
22PERLVAR(Tretstack, OP **)
23PERLVAR(Tretstack_ix, I32)
24PERLVAR(Tretstack_max, I32)
25
26PERLVAR(Tmarkstack, I32 *)
27PERLVAR(Tmarkstack_ptr, I32 *)
28PERLVAR(Tmarkstack_max, I32 *)
29
30PERLVAR(TSv, SV *)
31PERLVAR(TXpv, XPV *)
32PERLVAR(Tstatbuf, struct stat)
33#ifdef HAS_TIMES
34PERLVAR(Ttimesbuf, struct tms)
35#endif
36
37/* XXX What about regexp stuff? */
38
39/* Now the fields that used to be "per interpreter" (even when global) */
40
41/* Fields used by magic variables such as $@, $/ and so on */
42PERLVAR(Ttainted, bool)
43PERLVAR(Tcurpm, PMOP *)
44PERLVAR(Tnrs, SV *)
45PERLVAR(Trs, SV *)
46PERLVAR(Tlast_in_gv, GV *)
47PERLVAR(Tofs, char *)
48PERLVAR(Tofslen, STRLEN)
49PERLVAR(Tdefoutgv, GV *)
50PERLVAR(Tchopset, char *)
51PERLVAR(Tformtarget, SV *)
52PERLVAR(Tbodytarget, SV *)
53PERLVAR(Ttoptarget, SV *)
54
55 /* Stashes */
56PERLVAR(Tdefstash, HV *)
57PERLVAR(Tcurstash, HV *)
58
59 /* Stacks */
60PERLVAR(Ttmps_stack, SV **)
61PERLVAR(Ttmps_ix, I32)
62PERLVAR(Ttmps_floor, I32)
63PERLVAR(Ttmps_max, I32)
64
65PERLVAR(Tin_eval, int)
66PERLVAR(Trestartop, OP *)
67PERLVAR(Tdelaymagic, int)
68PERLVAR(Tdirty, bool)
69PERLVAR(Tlocalizing, U8)
70PERLVAR(Tcurcop, COP *)
71
72PERLVAR(Tcxstack, PERL_CONTEXT *)
73PERLVAR(Tcxstack_ix, I32)
74PERLVAR(Tcxstack_max, I32)
75
76PERLVAR(Tcurstack, AV *)
77PERLVAR(Tmainstack, AV *)
78PERLVAR(Ttop_env, JMPENV *)
79PERLVAR(Tstart_env, JMPENV) /* Top of top_env longjmp() chain */
80
81/* XXX Sort stuff, firstgv secongv and so on? */
82
83PERLVAR(oursv, SV *)
84PERLVAR(cvcache, HV *)
85PERLVAR(self, perl_os_thread) /* Underlying thread object */
86PERLVAR(flags, U32)
87PERLVAR(threadsv, AV *) /* Per-thread SVs ($_, $@ etc.) */
88PERLVAR(specific, AV *) /* Thread-specific user data */
89PERLVAR(errsv, SV *) /* Backing SV for $@ */
90PERLVAR(errhv, HV *) /* HV for what was %@ in pp_ctl.c */
91PERLVAR(mutex, perl_mutex) /* For the fields others can change */
92PERLVAR(tid, U32)
93PERLVAR(prev, struct perl_thread *)
94PERLVAR(next, struct perl_thread *) /* Circular linked list of threads */
95
96#ifdef HAVE_THREAD_INTERN
97PERLVAR(i, struct thread_intern) /* Platform-dependent internals */
98#endif
99
100PERLVAR(trailing_nul, char) /* For the sake of thrsv and oursv */
101