diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-08-08 15:01:48 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-08-08 17:54:36 +0100 |
commit | 85dca89a8f321bc581a3d365d95ab0c56368ed78 (patch) | |
tree | ca2336c2dad9d00e09d0201a98a2bb4107890f3f /gv.c | |
parent | d5713896ecd1399c9c6c4076514a33eb2880d8c3 (diff) | |
download | perl-85dca89a8f321bc581a3d365d95ab0c56368ed78.tar.gz |
Perl_newIO() can become a mathom by making newIO() a wrapper around newSV_type()
and tweaking Perl_sv_upgrade().
Diffstat (limited to 'gv.c')
-rw-r--r-- | gv.c | 21 |
1 files changed, 0 insertions, 21 deletions
@@ -1485,27 +1485,6 @@ Perl_gv_efullname4(pTHX_ SV *sv, const GV *gv, const char *prefix, bool keepmain gv_fullname4(sv, egv ? egv : gv, prefix, keepmain); } -IO * -Perl_newIO(pTHX) -{ - dVAR; - GV *iogv; - IO * const io = MUTABLE_IO(newSV_type(SVt_PVIO)); - /* This used to read SvREFCNT(io) = 1; - It's not clear why the reference count needed an explicit reset. NWC - */ - assert (SvREFCNT(io) == 1); - SvOBJECT_on(io); - /* Clear the stashcache because a new IO could overrule a package name */ - hv_clear(PL_stashcache); - iogv = gv_fetchpvs("FileHandle::", 0, SVt_PVHV); - /* unless exists($main::{FileHandle}) and defined(%main::FileHandle::) */ - if (!(iogv && GvHV(iogv) && HvARRAY(GvHV(iogv)))) - iogv = gv_fetchpvs("IO::Handle::", GV_ADD, SVt_PVHV); - SvSTASH_set(io, MUTABLE_HV(SvREFCNT_inc(GvHV(iogv)))); - return io; -} - void Perl_gv_check(pTHX_ const HV *stash) { |