Remove use of SAVEDESTRUCTOR_X(clear_re...) from regcomp.c
authorFather Chrysostomos <sprout@cpan.org>
Sat, 1 Dec 2012 04:20:19 +0000 (20:20 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 3 Dec 2012 16:53:43 +0000 (08:53 -0800)
commita5e7bc5140f5e3ea032317511826fa1cc38ec7fc
tree0795d2a5c4978e440d0b7e8258977bb6d3b42707
parent8c9e24c7f6088cb5fe0779c2c11c1fb4ca8ae693
Remove use of SAVEDESTRUCTOR_X(clear_re...) from regcomp.c

The purpose of this is to free the regexp when croaking.
SAVEDESTRUCTOR_X calls clear_re on scope exit.  clear_re does
ReREFCNT_dec.

It used to be necessary to do it this way before regular expres-
sions were SVs.

Since v5.10.0-145-g84679df, regexps have been SVs, and ReREFCNT_dec is
effectively an alias for SvREFCNT_dec.

There will be one less function call on scope exit when regexp compi-
lation croaks if we use SAVEFREESV instead of SAVEDESTRUCTOR_X.
regcomp.c