Optimise S_incpush() by avoiding repeatedly copying libdir to subdir.
authorNicholas Clark <nick@ccl4.org>
Sun, 22 Feb 2009 21:27:18 +0000 (22:27 +0100)
committerNicholas Clark <nick@ccl4.org>
Sun, 22 Feb 2009 21:27:18 +0000 (22:27 +0100)
commit7ffdaae673354e3b3ebbecaecdc009fee9fa90e7
tree793fa9334bff2f0b602302c611c01885ae93a7ac
parent10cc20f60c359ae5d3303fc24a4918518974bc83
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.
embed.fnc
embed.h
perl.c
proto.h