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