diff options
author | Nicholas Clark <nick@ccl4.org> | 2008-02-02 11:05:17 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2008-02-02 11:05:17 +0000 |
commit | 92e45a3e6a37177cdf8021650cda6bd5a43fdbdf (patch) | |
tree | 73fdbcaeb0f29946f7d0689a0cd48c96c9cef7f9 /perlio.c | |
parent | fb632ce3b9716ad53f50ed424ce0956dc2d24e5d (diff) | |
download | perl-92e45a3e6a37177cdf8021650cda6bd5a43fdbdf.tar.gz |
In XS_PerlIO_get_layers() take advantage of the implementation of
PerlIO_get_layers(), by co-opting the new SVs it creates, rather than
copying them.
p4raw-id: //depot/perl@33182
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -759,6 +759,11 @@ PerlIO_get_layers(pTHX_ PerlIO *f) PerlIOl *l = PerlIOBase(f); while (l) { + /* There is some collusion in the implementation of + XS_PerlIO_get_layers - it knows that name and flags are + generated as fresh SVs here, and takes advantage of that to + "copy" them by taking a reference. If it changes here, it needs + to change there too. */ SV * const name = l->tab && l->tab->name ? newSVpv(l->tab->name, 0) : &PL_sv_undef; SV * const arg = l->tab && l->tab->Getarg ? |