summaryrefslogtreecommitdiff
path: root/cop.h
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1999-11-11 10:32:54 +0000
committerGurusamy Sarathy <gsar@cpan.org>1999-11-11 10:32:54 +0000
commit11faa288e292c27cb2ddc4ccdc483b523d26ce19 (patch)
treecdd7a04e7b75f54261ca8d31b5dbd98d7053dd10 /cop.h
parent57843af05bc7863df9b9bfb6b37e3a29d08532a9 (diff)
downloadperl-11faa288e292c27cb2ddc4ccdc483b523d26ce19.tar.gz
avoid stash pointers in optree under USE_ITHREADS
p4raw-id: //depot/perl@4546
Diffstat (limited to 'cop.h')
-rw-r--r--cop.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/cop.h b/cop.h
index 89fab9424e..d5f7f423a6 100644
--- a/cop.h
+++ b/cop.h
@@ -10,10 +10,11 @@
struct cop {
BASEOP
char * cop_label; /* label for this construct */
- HV * cop_stash; /* package line was compiled in */
#ifdef USE_ITHREADS
+ char * cop_stashpv; /* package line was compiled in */
char * cop_file; /* file name the following line # is from */
#else
+ HV * cop_stash; /* package line was compiled in */
GV * cop_filegv; /* file the following line # is from */
#endif
U32 cop_seq; /* parse sequence number */
@@ -33,11 +34,11 @@ struct cop {
? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv)
# define CopFILEAV(c) (CopFILE(c) \
? GvAV(gv_fetchfile(CopFILE(c))) : Nullav)
-# define CopSTASH(c) (CopSTASHPV(c) \
- ? gv_fetchstash(CopSTASHPV(c)) : Nullhv)
-# define CopSTASH_set(c,hv) ((c)->cop_stashpv = HvNAME(hv)) /* XXX */
-# define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = pv)
# define CopSTASHPV(c) ((c)->cop_stashpv)
+# define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = savepv(pv)) /* XXX */
+# define CopSTASH(c) (CopSTASHPV(c) \
+ ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv)
+# define CopSTASH_set(c,hv) CopSTASHPV_set(c, HvNAME(hv))
#else
# define CopFILEGV(c) ((c)->cop_filegv)
# define CopFILEGV_set(c,gv) ((c)->cop_filegv = gv)
@@ -48,6 +49,7 @@ struct cop {
# define CopSTASH(c) ((c)->cop_stash)
# define CopSTASH_set(c,hv) ((c)->cop_stash = hv)
# define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch)
+# define CopSTASHPV_set(c,pv) CopSTASH_set(c, gv_stashpv(pv,GV_ADD))
#endif /* USE_ITHREADS */
#define CopLINE(c) ((c)->cop_line)