This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
In B.xs refactor cc_opclassname() to make_op_object().
authorNicholas Clark <nick@ccl4.org>
Mon, 8 Nov 2010 11:54:25 +0000 (11:54 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 8 Nov 2010 11:54:25 +0000 (11:54 +0000)
commit6079961fee8cf49c4c5439b5accb5d27994e74f0
tree5fa4017d19b64209fd4b42417f6d71d2f1d3634b
parent0a49bb245ba47522d06cd04cb0bb92cb03d49ee9
In B.xs refactor cc_opclassname() to make_op_object().

All bar one of the callers to cc_opclassname() were using it in the same way -
to pass as the second argument of newSVrv(), whose first argument was a new
mortal, and return value was used with sv_setiv() and PTR2IV(). So clearly
*that* is the common code needed.

Inline the existing code (all 1 line of it) in the other location that called
cc_opclassname(). As the typemap was using cc_opclassname(), replace the 4
implicit uses of it with explicit PPCODE sections. Curiously, removing the use
of this typemap actually reduces the line count of B.xs

On this platform, this reduces the object code size by almost .5K.
ext/B/B.xs
ext/B/typemap