diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-02-22 22:27:18 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-02-22 22:27:18 +0100 |
commit | 7ffdaae673354e3b3ebbecaecdc009fee9fa90e7 (patch) | |
tree | 793fa9334bff2f0b602302c611c01885ae93a7ac /embed.h | |
parent | 10cc20f60c359ae5d3303fc24a4918518974bc83 (diff) | |
download | perl-7ffdaae673354e3b3ebbecaecdc009fee9fa90e7.tar.gz |
Optimise S_incpush() by avoiding repeatedly copying libdir to subdir.
Specifically, copy it once with newSVsv(), then pass libdir to
S_incpush_if_exists(), and if that creates a new SV, use newSVsv() there to
re-do the copy. Otherwise reset the length of the passed-in SV (which is
subdir), back to the length of libdir, effectively truncating it back to be
equal to libdir. This avoids repeated copying of the same bytes over the same
memory that already holds those bytes.
Diffstat (limited to 'embed.h')
-rw-r--r-- | embed.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -3646,7 +3646,7 @@ #ifdef PERL_CORE #define parse_body(a,b) S_parse_body(aTHX_ a,b) #define run_body(a) S_run_body(aTHX_ a) -#define incpush_if_exists(a,b) S_incpush_if_exists(aTHX_ a,b) +#define incpush_if_exists(a,b,c) S_incpush_if_exists(aTHX_ a,b,c) #endif #endif #if defined(PERL_IN_PP_C) || defined(PERL_DECL_PROT) |