summaryrefslogtreecommitdiff
path: root/perl.c
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 /perl.c
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 'perl.c')
-rw-r--r--perl.c17
1 files changed, 3 insertions, 14 deletions
diff --git a/perl.c b/perl.c
index e7f7ad6c85..d7e3ace6df 100644
--- a/perl.c
+++ b/perl.c
@@ -696,15 +696,8 @@ perl_destruct(pTHXx)
if (!specialCopIO(PL_compiling.cop_io))
SvREFCNT_dec(PL_compiling.cop_io);
PL_compiling.cop_io = Nullsv;
-#ifdef USE_ITHREADS
- Safefree(CopFILE(&PL_compiling));
- CopFILE(&PL_compiling) = Nullch;
- Safefree(CopSTASHPV(&PL_compiling));
-#else
- SvREFCNT_dec(CopFILEGV(&PL_compiling));
- CopFILEGV(&PL_compiling) = Nullgv;
- /* cop_stash is not refcounted */
-#endif
+ CopFILE_free(&PL_compiling);
+ CopSTASH_free(&PL_compiling);
/* Prepare to destruct main symbol table. */
@@ -2717,11 +2710,7 @@ S_open_script(pTHX_ char *scriptname, bool dosearch, SV *sv, int *fdscript)
}
}
-# ifdef USE_ITHREADS
- Safefree(CopFILE(PL_curcop));
-# else
- SvREFCNT_dec(CopFILEGV(PL_curcop));
-# endif
+ CopFILE_free(PL_curcop);
CopFILE_set(PL_curcop, PL_origfilename);
if (strEQ(PL_origfilename,"-"))
scriptname = "";