summaryrefslogtreecommitdiff
path: root/scope.c
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-11-21 18:28:22 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-11-21 18:28:22 +0000
commit54b9620dd49f76536ba0792f6f471615a414bd6a (patch)
tree0f7080854c047d90b09822aec3b81dd2fcbabd89 /scope.c
parentff2faa2b5a0809a5124aa90fc1d07503e49a73fb (diff)
downloadperl-54b9620dd49f76536ba0792f6f471615a414bd6a.tar.gz
$_ is now per-thread (rather a lot of changes). Only tested under
*-linux-thread at the moment. p4raw-id: //depot/perl@274
Diffstat (limited to 'scope.c')
-rw-r--r--scope.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/scope.c b/scope.c
index cc5c9c88ce..43820724ab 100644
--- a/scope.c
+++ b/scope.c
@@ -330,6 +330,22 @@ save_sptr(SV **sptr)
SSPUSHINT(SAVEt_SPTR);
}
+SV **
+save_threadsv(PADOFFSET i)
+{
+#ifdef USE_THREADS
+ dTHR;
+ SV **svp = av_fetch(thr->threadsv, i, FALSE);
+ DEBUG_L(PerlIO_printf(PerlIO_stderr(), "save_threadsv %u: %p %p:%s\n",
+ i, svp, *svp, SvPEEK(*svp)));
+ save_svref(svp);
+ return svp;
+#else
+ croak("panic: save_threadsv called in non-threaded perl");
+ return 0;
+#endif /* USE_THREADS */
+}
+
void
save_nogv(GV *gv)
{
@@ -475,6 +491,9 @@ leave_scope(I32 base)
ptr = SSPOPPTR;
restore_sv:
sv = *(SV**)ptr;
+ DEBUG_L(PerlIO_printf(PerlIO_stderr(),
+ "restore svref: %p %p:%s -> %p:%s\n",
+ ptr, sv, SvPEEK(sv), value, SvPEEK(value)));
if (SvTYPE(sv) >= SVt_PVMG && SvMAGIC(sv) &&
SvTYPE(sv) != SVt_PVGV)
{