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