diff options
author | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-01-14 22:02:49 +0000 |
---|---|---|
committer | Nick Ing-Simmons <nik@tiuk.ti.com> | 2002-01-14 22:02:49 +0000 |
commit | 05ec9bb346c404c8906ed1ac374d4bce61c84f5d (patch) | |
tree | c0c3deb21e984b2371d1058155b645467055217d /op.h | |
parent | e567eb179f8c37fa2e2a16e90180982901849683 (diff) | |
download | perl-05ec9bb346c404c8906ed1ac374d4bce61c84f5d.tar.gz |
Use PerlMemShared for CopSTASHPV and CopFILE. MUCH harder than it sounds!
Need to use CopXXXXX macros everywhere and add CopSTASH_free
Add new scope type and add support for it to scope.c and scope stack
dup-er in sv.c. Add savesharedpv().
Also zealous version of Win32's vmem.h to catch all the abuses.
With this t/op/fork.t passes even with zealous checking and
checker is point a finger at various threads/shared issues.
PL_curcop->cop_io is still an issue.
p4raw-id: //depot/perlio@14259
Diffstat (limited to 'op.h')
-rw-r--r-- | op.h | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -299,17 +299,21 @@ struct pmop { #define PMf_COMPILETIME (PMf_MULTILINE|PMf_SINGLELINE|PMf_LOCALE|PMf_FOLD|PMf_EXTENDED) #ifdef USE_ITHREADS + # define PmopSTASHPV(o) ((o)->op_pmstashpv) -# define PmopSTASHPV_set(o,pv) ((o)->op_pmstashpv = ((pv) ? savepv(pv) : Nullch)) +# define PmopSTASHPV_set(o,pv) (PmopSTASHPV(o) = savesharedpv(pv)) # define PmopSTASH(o) (PmopSTASHPV(o) \ ? gv_stashpv(PmopSTASHPV(o),GV_ADD) : Nullhv) -# define PmopSTASH_set(o,hv) PmopSTASHPV_set(o, (hv) ? HvNAME(hv) : Nullch) +# define PmopSTASH_set(o,hv) PmopSTASHPV_set(o, ((hv) ? HvNAME(hv) : Nullch)) +# define PmopSTASH_free(o) PerlMemShared_free(PmopSTASHPV(o)) + #else # define PmopSTASH(o) ((o)->op_pmstash) # define PmopSTASH_set(o,hv) ((o)->op_pmstash = (hv)) # define PmopSTASHPV(o) (PmopSTASH(o) ? HvNAME(PmopSTASH(o)) : Nullch) /* op_pmstash is not refcounted */ # define PmopSTASHPV_set(o,pv) PmopSTASH_set((o), gv_stashpv(pv,GV_ADD)) +# define PmopSTASH_free(o) #endif struct svop { |