cvs commit: ponie/perl embed.fnc embed.h proto.h sv.c
[email protected] (Nicholas Clark) 4 May 2004 10:20:03 -0000
| Newsgroups | perl.ponie.changes |
|---|---|
| Message-ID | <[email protected]> |
cvsuser 04/05/04 03:20:03
Modified: . Configure.pl
perl embed.fnc embed.h proto.h sv.c
Log:
IO, IO, it's off to work we go
Revision Changes Path
1.23 +1 -1 ponie/Configure.pl
Index: Configure.pl
===================================================================
RCS file: /cvs/public/ponie/Configure.pl,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -w -r1.22 -r1.23
--- Configure.pl 3 May 2004 22:21:56 -0000 1.22
+++ Configure.pl 4 May 2004 10:20:03 -0000 1.23
@@ -47,7 +47,7 @@
my $template = do {local $/; <F>};
close F or die $!;
chdir('parrot') || die "You need to checkout parrot inside ponie";
- foreach (qw(rv pvlv pvav pvhv)) {
+ foreach (qw(rv pvlv pvav pvhv pvio)) {
my $file = File::Spec->catfile('classes', "perl5$_.pmc");
if (-e $file) {
unlink $file or die "unlink '$file' failed: $!";
1.16 +3 -0 ponie/perl/embed.fnc
Index: embed.fnc
===================================================================
RCS file: /cvs/public/ponie/perl/embed.fnc,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -r1.15 -r1.16
--- embed.fnc 7 Apr 2004 10:37:27 -0000 1.15
+++ embed.fnc 4 May 2004 10:20:03 -0000 1.16
@@ -1260,6 +1260,7 @@
s |XPVCV* |new_xpvcv
s |Parrot_PMC |new_xpvav
s |Parrot_PMC |new_xpvhv
+s |Parrot_PMC |new_xpvio
s |XPVMG* |new_xpvmg
s |Parrot_PMC |new_xpvlv
s |XPVBM* |new_xpvbm
@@ -1272,10 +1273,12 @@
s |void |del_xpvcv |XPVCV* p
s |void |del_xpvav |Parrot_PMC p
s |void |del_xpvhv |Parrot_PMC p
+s |void |del_xpvio |Parrot_PMC p
s |void |del_xpvmg |XPVMG* p
s |void |del_xpvlv |Parrot_PMC p
s |void |del_xpvbm |XPVBM* p
s |void |del_xrv |XRV* p
+s |void |zero_xpvio |SV *io
s |void |sv_unglob |SV* sv
s |void |not_a_number |SV *sv
s |I32 |visit |SVFUNC_t f
1.13 +18 -0 ponie/perl/embed.h
Index: embed.h
===================================================================
RCS file: /cvs/public/ponie/perl/embed.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -w -r1.12 -r1.13
--- embed.h 7 Apr 2004 10:37:27 -0000 1.12
+++ embed.h 4 May 2004 10:20:03 -0000 1.13
@@ -1850,6 +1850,9 @@
#define new_xpvhv S_new_xpvhv
#endif
#ifdef PERL_CORE
+#define new_xpvio S_new_xpvio
+#endif
+#ifdef PERL_CORE
#define new_xpvmg S_new_xpvmg
#endif
#ifdef PERL_CORE
@@ -1886,6 +1889,9 @@
#define del_xpvhv S_del_xpvhv
#endif
#ifdef PERL_CORE
+#define del_xpvio S_del_xpvio
+#endif
+#ifdef PERL_CORE
#define del_xpvmg S_del_xpvmg
#endif
#ifdef PERL_CORE
@@ -1898,6 +1904,9 @@
#define del_xrv S_del_xrv
#endif
#ifdef PERL_CORE
+#define zero_xpvio S_zero_xpvio
+#endif
+#ifdef PERL_CORE
#define sv_unglob S_sv_unglob
#endif
#ifdef PERL_CORE
@@ -4396,6 +4405,9 @@
#define new_xpvhv() S_new_xpvhv(aTHX)
#endif
#ifdef PERL_CORE
+#define new_xpvio() S_new_xpvio(aTHX)
+#endif
+#ifdef PERL_CORE
#define new_xpvmg() S_new_xpvmg(aTHX)
#endif
#ifdef PERL_CORE
@@ -4432,6 +4444,9 @@
#define del_xpvhv(a) S_del_xpvhv(aTHX_ a)
#endif
#ifdef PERL_CORE
+#define del_xpvio(a) S_del_xpvio(aTHX_ a)
+#endif
+#ifdef PERL_CORE
#define del_xpvmg(a) S_del_xpvmg(aTHX_ a)
#endif
#ifdef PERL_CORE
@@ -4442,6 +4457,9 @@
#endif
#ifdef PERL_CORE
#define del_xrv(a) S_del_xrv(aTHX_ a)
+#endif
+#ifdef PERL_CORE
+#define zero_xpvio(a) S_zero_xpvio(aTHX_ a)
#endif
#ifdef PERL_CORE
#define sv_unglob(a) S_sv_unglob(aTHX_ a)
1.16 +3 -0 ponie/perl/proto.h
Index: proto.h
===================================================================
RCS file: /cvs/public/ponie/perl/proto.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -r1.15 -r1.16
--- proto.h 7 Apr 2004 10:37:27 -0000 1.15
+++ proto.h 4 May 2004 10:20:03 -0000 1.16
@@ -1212,6 +1212,7 @@
STATIC XPVCV* S_new_xpvcv(pTHX);
STATIC Parrot_PMC S_new_xpvav(pTHX);
STATIC Parrot_PMC S_new_xpvhv(pTHX);
+STATIC Parrot_PMC S_new_xpvio(pTHX);
STATIC XPVMG* S_new_xpvmg(pTHX);
STATIC Parrot_PMC S_new_xpvlv(pTHX);
STATIC XPVBM* S_new_xpvbm(pTHX);
@@ -1224,10 +1225,12 @@
STATIC void S_del_xpvcv(pTHX_ XPVCV* p);
STATIC void S_del_xpvav(pTHX_ Parrot_PMC p);
STATIC void S_del_xpvhv(pTHX_ Parrot_PMC p);
+STATIC void S_del_xpvio(pTHX_ Parrot_PMC p);
STATIC void S_del_xpvmg(pTHX_ XPVMG* p);
STATIC void S_del_xpvlv(pTHX_ Parrot_PMC p);
STATIC void S_del_xpvbm(pTHX_ XPVBM* p);
STATIC void S_del_xrv(pTHX_ XRV* p);
+STATIC void S_zero_xpvio(pTHX_ SV *io);
STATIC void S_sv_unglob(pTHX_ SV* sv);
STATIC void S_not_a_number(pTHX_ SV *sv);
STATIC I32 S_visit(pTHX_ SVFUNC_t f);
1.23 +25 -3 ponie/perl/sv.c
Index: sv.c
===================================================================
RCS file: /cvs/public/ponie/perl/sv.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -w -r1.22 -r1.23
--- sv.c 3 May 2004 22:21:56 -0000 1.22
+++ sv.c 4 May 2004 10:20:03 -0000 1.23
@@ -1280,8 +1280,23 @@
#define new_XPVFM() my_safemalloc(sizeof(XPVFM))
#define del_XPVFM(p) my_safefree(p)
-#define new_XPVIO() my_safemalloc(sizeof(XPVIO))
-#define del_XPVIO(p) my_safefree(p)
+#define new_XPVIO() (void*)new_xpvio()
+#define del_XPVIO(p) del_xpvio((XPVIO *)p)
+
+
+STATIC Parrot_PMC
+S_new_xpvio(pTHX)
+{
+ Parrot_Int type = Parrot_PMC_typenum(PL_Parrot, "Perl5PVIO");
+ Parrot_PMC io = Parrot_PMC_new(PL_Parrot, type);
+ Parrot_register_pmc(PL_Parrot, io);
+ return MUMBLE(io);
+}
+STATIC void
+S_del_xpvio(pTHX_ Parrot_PMC io)
+{
+ Parrot_unregister_pmc(PL_Parrot, io);
+}
MAGIC** Perl_macro_SvMAGIC (pTHX_ SV *sv) {
if(SvPMC(sv)) {
@@ -1564,6 +1579,12 @@
return &((XPVIO*)SvANY(sv))->xio_flags;
}
+void
+S_zero_xpvio(pTHX_ SV *io)
+{
+ assert(SvPMC(io));
+ Zero(Parrot_PMC_get_pointer(PL_Parrot, MUMBLE(SvANY(io))), 1, XPVIO);
+}
/*
@@ -1848,7 +1869,8 @@
break;
case SVt_PVIO:
SvANY(sv) = new_XPVIO();
- Zero(SvANY(sv), 1, XPVIO);
+ SvPMC_on(sv);
+ zero_xpvio(sv);
SvPVX(sv) = pv;
SvCUR(sv) = cur;
SvLEN(sv) = len;