Front page | perl.perl5.porters |
Postings from November 2008
Re: "XXX should fix CXINC macro"
Thread Previous
From:
demerphq
Date:
November 27, 2008 15:32
Subject:
Re: "XXX should fix CXINC macro"
Message ID:
9b18b3110811271532l29326289g2c9375dea950c8b7@mail.gmail.com
2008/11/27 Nicholas Clark <nick@ccl4.org>:
> On Thu, Nov 27, 2008 at 01:32:47PM -0800, Chip Salzenberg wrote:
>
>> My second CXINC patch[2] was superior to my first patch and to Larry's, but
>> it simply arrived too late, as Larry's was already in and a release was
>> imminent.
>
> So undo Larry's change and apply your second?
>
>> PS: Shirley, CXINC isn't part of the public API. (?)
>
> Well, it doesn't seem to be. But it's curious how its name gets out there:
> Data-Dump-Streamer/Streamer.xs
> 97: Renew(cxstack, cxstack_max + 1, struct context); /* XXX should fix CXINC macro */
>
> List-MoreUtils/MoreUtils.xs
> 68: Renew(cxstack, cxstack_max + 1, struct context); /* XXX should fix CXINC macro */
>
> Scalar-List-Utils/Util.xs
> 43: Renew(cxstack, cxstack_max + 1, struct context); /* XXX should fix CXINC macro */
> perl/ext/List/Util/Util.xs
> 43: Renew(cxstack, cxstack_max + 1, struct context); /* XXX should fix CXINC macro */
>
> perl/scope.c
> 75: Renew(cxstack, cxstack_max + 1, PERL_CONTEXT); /* XXX should fix CXINC macro */
....
> But in turn it's used in two other macros, PUSHBLOCK and PUSHSUBST, and
> they seem to be used more widely:
....
> [I leave in the hits in the perl core distribution to show the "official"
> usage. I believe that "multicall.h" is considered "supported", hence CXINC
> and therefore Perl_cxinc() are components of something that is public]
>
> [Also, I note that that XXX comment appears in (at least) one place where
> neither CXINC nor PUSHBLOCK are used - Streamer.xs. So I'm not sure how
> many times the hits are from copy-paste which has now become vestigial.]
>
>
> Whilst there is definitely some excellent code out on CPAN, it seems that
> at the other end there is cargo-cult and "it compiles - ship it".
The code in the Streamer extension is cargo cult to the extent that it
copies relatively closely code that was in Scalar::Utils. Also I
notice from a comment in Util.xs:
/* Some platforms have strict exports. And before 5.7.3 cxinc (or Perl_cxinc)
was not exported. Therefore platforms like win32, VMS etc have problems
so we redefine it here -- GMB
*/
which explains why it was necessary in the first place.
However since I was only interested in the Scalar routines in the
scalar-utils package Its highly possible that some of the defines I
copied from Scalar::Utils were unnecessary, looking at the code it
seems like the multicall stuff is only used in the list routines.
Anyway, Scalar::Util is sort of a model XS file so it shouldnt be
surprising it gets copied here and there. Have you seen all the stuff
it does to compile on virtually every perl?
Yves
--
perl -Mre=debug -e "/just|another|perl|hacker/"
Thread Previous