diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-02-25 00:39:30 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-02-25 00:39:30 +0000 |
commit | f7877b281b40407827939f44ea94226de573cdbc (patch) | |
tree | a9a5cac49427908841ae0bf5a3af524fee855e6a /pp.c | |
parent | fb4fc1faf0cb0e6b2bec4f31ddbca2817f387a6e (diff) | |
download | perl-f7877b281b40407827939f44ea94226de573cdbc.tar.gz |
Store GvGP in the SV head union. For all the common lookups [eg GvCV()]
this avoids 1 pointer dereference and the associated risk of a CPU
cache miss. Although this patch looks deceptively small, I fear its
CBV(*) might be rather high.
(* Crack By Volume)
p4raw-id: //depot/perl@27323
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -3016,7 +3016,9 @@ PP(pp_substr) Perl_warner(aTHX_ packWARN(WARN_SUBSTR), "Attempt to use reference as lvalue in substr"); } - if (SvOK(sv)) /* is it defined ? */ + if (isGV_with_GP(sv)) + SvPV_force_nolen(sv); + else if (SvOK(sv)) /* is it defined ? */ (void)SvPOK_only_UTF8(sv); else sv_setpvn(sv,"",0); /* avoid lexical reincarnation */ |