diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-11-11 10:32:54 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-11-11 10:32:54 +0000 |
commit | 11faa288e292c27cb2ddc4ccdc483b523d26ce19 (patch) | |
tree | cdd7a04e7b75f54261ca8d31b5dbd98d7053dd10 /cop.h | |
parent | 57843af05bc7863df9b9bfb6b37e3a29d08532a9 (diff) | |
download | perl-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.h | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -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) |