summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2007-10-18 12:32:42 +0000
committerNicholas Clark <nick@ccl4.org>2007-10-18 12:32:42 +0000
commit8e3a4a3079a43c5cf5fb5f844ffb0b9d1d8b571d (patch)
tree7775ffd2f2d03da97de8ed26f88c0afbe070f700 /gv.c
parent19bad6733a83fa572b0d6a19b4693ea22c241ab0 (diff)
downloadperl-8e3a4a3079a43c5cf5fb5f844ffb0b9d1d8b571d.tar.gz
No need to call strlen() on the result of CopSTASHPV() when unthreaded,
as the length is already known. Hence conditionally compile out the logic related to the call to strlen() from S_method_common(), and use newSVhek in S_gv_get_super_pkg(). p4raw-id: //depot/perl@32130
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gv.c b/gv.c
index 241e6167b6..a9eb65a853 100644
--- a/gv.c
+++ b/gv.c
@@ -564,7 +564,12 @@ S_gv_get_super_pkg(pTHX_ const char* name, I32 namelen)
superisa = GvAVn(gv);
GvMULTI_on(gv);
sv_magic((SV*)superisa, (SV*)gv, PERL_MAGIC_isa, NULL, 0);
+#ifdef USE_ITHREADS
av_push(superisa, newSVpv(CopSTASHPV(PL_curcop), 0));
+#else
+ av_push(superisa, newSVhek(CopSTASH(PL_curcop)
+ ? HvNAME_HEK(CopSTASH(PL_curcop)) : NULL));
+#endif
return stash;
}