summaryrefslogtreecommitdiff
path: root/op.h
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2002-01-14 22:02:49 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2002-01-14 22:02:49 +0000
commit05ec9bb346c404c8906ed1ac374d4bce61c84f5d (patch)
treec0c3deb21e984b2371d1058155b645467055217d /op.h
parente567eb179f8c37fa2e2a16e90180982901849683 (diff)
downloadperl-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.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/op.h b/op.h
index 2bfdced273..5c8e3674f1 100644
--- a/op.h
+++ b/op.h
@@ -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 {