This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Split PL_padix into two variables
authorFather Chrysostomos <sprout@cpan.org>
Wed, 27 Aug 2014 06:05:16 +0000 (23:05 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 28 Aug 2014 20:04:17 +0000 (13:04 -0700)
commitb54c5e14b7fb9ecbcf34d74dd140de12cb73ff78
tree9ccbd5504fa7696c60ca2cfe7530d383b525a71c
parent8ce2f624198802e520eba6523c32ad6429463198
Split PL_padix into two variables

PL_padix keeps track of the position in the pad when pad_alloc has to
start scanning for an available slot.

The availability of a slot is determined differently for targets
(which may reuse slots that are already targets from previous state-
ments, at least when pad_reset is enabled) and constants (which may
not reuse targets).

Having the same index for both may require scanning the entire pad for
allocating a constant or GV.

t/re/uniprops.t was running far too slowly under USE_BROKEN_PAD_RESET
because of this.  pad_reset would reset PL_padix to point to the
beginning of a pad with a few hundred thousand entries.  pad_alloc
would then have to scan the entire pad before adding a GV to the end.

It is still too slow, even with this commit, but for other reasons.
(This is just a partial fix.)
embedvar.h
intrpvar.h
pad.c