From: Jarkko Hietaniemi Date: Fri, 6 Apr 2001 13:31:45 +0000 (+0000) Subject: Integrate changes #9584,9587 from maintperl into mainline. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=26d9b02fa65570745e70dcbd0d92c1354fc4ecff;p=p5sagit%2Fp5-mst-13.2.git Integrate changes #9584,9587 from maintperl into mainline. keep eval"" CVs alive until the end of the statement in which they're called add README.macos (from Chris Nandor) tyop in change#9555 p4raw-link: @9587 on //depot/maint-5.6/perl: d72c2fc956b5cb46ede17d06f89a463c78f1cf5f p4raw-link: @9584 on //depot/maint-5.6/perl: e6fbcc36a54a8afd8dbcdcb9a8d8e178df530b97 p4raw-link: @9555 on //depot/perl: 6a0af2f17bcde4767b90a72eff7083c5effff21d p4raw-id: //depot/perl@9588 p4raw-branched: from //depot/maint-5.6/perl@9583 'branch in' README.macos p4raw-integrated: from //depot/maint-5.6/perl@9583 'copy in' pod/perlfaq9.pod (@9585..) 'merge in' scope.h (@8568..) pod/perl.pod (@8986..) MANIFEST (@9227..) win32/Makefile (@9286..) pp_ctl.c scope.c (@9288..) global.sym (@9289..) embed.h embed.pl objXSUB.h perlapi.c proto.h (@9292..) pod/buildtoc.PL (@9312..) win32/makefile.mk (@9495..) sv.c (@9496..) pod/perlguts.pod (@9514..) --- diff --git a/MANIFEST b/MANIFEST index 11c4c57..23f39bf7 100644 --- a/MANIFEST +++ b/MANIFEST @@ -47,6 +47,7 @@ README.epoc Notes about EPOC port README.hpux Notes about HP-UX port README.hurd Notes about GNU/Hurd port README.machten Notes about Power MachTen port +README.macos Notes about Mac OS (Classic) README.micro Notes about microperl README.mint Notes about Atari MiNT port README.mpeix Notes about MPE/iX port diff --git a/README.macos b/README.macos new file mode 100644 index 0000000..cc8121b --- /dev/null +++ b/README.macos @@ -0,0 +1,60 @@ +If you read this file _as_is_, just ignore the funny characters you see. +It is written in the POD format (see pod/perlpod.pod) which is specially +designed to be readable as is. + +=head1 NAME + +README.macos - Perl under Mac OS (Classic) + + +=head1 SYNOPSIS + +This document briefly describes perl under Mac OS (Classic). +If you are running perl under Mac OS X, you don't want to be +here (unless you are in the Classic environment under Mac OS X). + +When we say "Mac OS" below, we mean pre-Mac OS X, which includes +Mac OS 7, 8, and 9. + + +=head1 DESCRIPTION + +The perl 5.6.1 source itself builds on Mac OS, with some additional +pieces. Support for Mac OS is now in the perl core, and MacPerl will be +able to, in the future, keep in closer sync with regular perl releases. + +At this time, though, it is very buggy, and is under development. An +alpha release is coming very soon. + +To build perl for Mac OS (as an MPW tool), you will need the addition +of the "macos" subdirectory, distributed separately. It includes extra +source files, config files, and make files. It also includes a lot of +extra Mac-specific modules. + +To build the MacPerl application, you will also need the "macperl" +directory, which includes the source files for creating the +application itself. + +All of this is also available from the SourceForge site, via +HTTP, FTP, and anonymous CVS. + + http://macperl.sourceforge.net/ + +You will also need compilers and libraries, all of them freely +available. These are linked to from the SourceForge site. Go that site +for all things having to do with MacPerl development. + +MacPerl 5.2.0r4 is available on the CPAN and on SourceForge. It +is based on perl 5.004. + + +=head1 AUTHOR + +perl was ported to Mac OS by Matthias Neeracher +Eneeracher@mac.comE. It is currently maintained by Chris +Nandor Epudge@pobox.comE. + + +=head1 DATE + +Last modified 2001.04.05. diff --git a/embed.h b/embed.h index 8ec511b..685f9e8 100644 --- a/embed.h +++ b/embed.h @@ -599,6 +599,7 @@ #define save_iv Perl_save_iv #define save_list Perl_save_list #define save_long Perl_save_long +#define save_mortalizesv Perl_save_mortalizesv #define save_nogv Perl_save_nogv #define save_op Perl_save_op #define save_scalar Perl_save_scalar @@ -2090,6 +2091,7 @@ #define save_iv(a) Perl_save_iv(aTHX_ a) #define save_list(a,b) Perl_save_list(aTHX_ a,b) #define save_long(a) Perl_save_long(aTHX_ a) +#define save_mortalizesv(a) Perl_save_mortalizesv(aTHX_ a) #define save_nogv(a) Perl_save_nogv(aTHX_ a) #define save_op() Perl_save_op(aTHX) #define save_scalar(a) Perl_save_scalar(aTHX_ a) @@ -4099,6 +4101,8 @@ #define save_list Perl_save_list #define Perl_save_long CPerlObj::Perl_save_long #define save_long Perl_save_long +#define Perl_save_mortalizesv CPerlObj::Perl_save_mortalizesv +#define save_mortalizesv Perl_save_mortalizesv #define Perl_save_nogv CPerlObj::Perl_save_nogv #define save_nogv Perl_save_nogv #define Perl_save_op CPerlObj::Perl_save_op diff --git a/embed.pl b/embed.pl index e1ddd67..8cc04b0 100755 --- a/embed.pl +++ b/embed.pl @@ -1956,6 +1956,7 @@ Ap |void |save_item |SV* item Ap |void |save_iv |IV* iv Ap |void |save_list |SV** sarg|I32 maxsarg Ap |void |save_long |long* longp +Ap |void |save_mortalizesv|SV* sv Ap |void |save_nogv |GV* gv p |void |save_op Ap |SV* |save_scalar |GV* gv diff --git a/global.sym b/global.sym index 1895fbf..08f3d5e 100644 --- a/global.sym +++ b/global.sym @@ -358,6 +358,7 @@ Perl_save_item Perl_save_iv Perl_save_list Perl_save_long +Perl_save_mortalizesv Perl_save_nogv Perl_save_scalar Perl_save_pptr diff --git a/objXSUB.h b/objXSUB.h index 5643637..99d9a3e 100644 --- a/objXSUB.h +++ b/objXSUB.h @@ -1433,6 +1433,10 @@ #define Perl_save_long pPerl->Perl_save_long #undef save_long #define save_long Perl_save_long +#undef Perl_save_mortalizesv +#define Perl_save_mortalizesv pPerl->Perl_save_mortalizesv +#undef save_mortalizesv +#define save_mortalizesv Perl_save_mortalizesv #undef Perl_save_nogv #define Perl_save_nogv pPerl->Perl_save_nogv #undef save_nogv diff --git a/perlapi.c b/perlapi.c index bf08bff..63f94a9 100644 --- a/perlapi.c +++ b/perlapi.c @@ -2610,6 +2610,13 @@ Perl_save_long(pTHXo_ long* longp) ((CPerlObj*)pPerl)->Perl_save_long(longp); } +#undef Perl_save_mortalizesv +void +Perl_save_mortalizesv(pTHXo_ SV* sv) +{ + ((CPerlObj*)pPerl)->Perl_save_mortalizesv(sv); +} + #undef Perl_save_nogv void Perl_save_nogv(pTHXo_ GV* gv) diff --git a/pod/buildtoc.PL b/pod/buildtoc.PL index 140341b..dbe88af 100644 --- a/pod/buildtoc.PL +++ b/pod/buildtoc.PL @@ -160,6 +160,7 @@ if (-d "pod") { perlepoc perlhpux perlmachten + perlmacos perlmpeix perlos2 perlos390 @@ -179,6 +180,7 @@ if (-d "pod") { perlepoc perlhpux perlmachten + perlmacos perlmpeix perlos2 perlos390 diff --git a/pod/perl.pod b/pod/perl.pod index fd55b8d..3d0cbbe 100644 --- a/pod/perl.pod +++ b/pod/perl.pod @@ -114,6 +114,7 @@ For ease of access, the Perl manual has been split up into several sections: perlepoc Perl notes for EPOC perlhpux Perl notes for HP-UX perlmachten Perl notes for Power MachTen + perlmacos Perl notes for Mac OS (Classic) perlmpeix Perl notes for MPE/iX perlos2 Perl notes for OS/2 perlos390 Perl notes for OS/390 diff --git a/pod/perlfaq9.pod b/pod/perlfaq9.pod index 2609c44..9676380 100644 --- a/pod/perlfaq9.pod +++ b/pod/perlfaq9.pod @@ -394,7 +394,7 @@ the MIME/QP encoding. Decoding BASE64 becomes as simple as: use MIME::Base64; $decoded = decode_base64($encoded); -The MIME-Tools package (available from CPAN) support exctraction with +The MIME-Tools package (available from CPAN) supports extraction with decoding of BASE64 encoded attachments and content directly from email messages. diff --git a/pod/perlguts.pod b/pod/perlguts.pod index dad868a..3b10af9 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -1127,8 +1127,20 @@ and back. =item C The refcount of C would be decremented at the end of -I. This is similar to C, which should (?) be -used instead. +I. This is similar to C in that it is also a +mechanism for doing a delayed C. However, while C +extends the lifetime of C until the beginning of the next statement, +C extends it until the end of the enclosing scope. These +lifetimes can be wildly different. + +Also compare C. + +=item C + +Just like C, but mortalizes C at the end of the current +scope instead of decrementing its reference count. This usually has the +effect of keeping C alive until the statement that called the currently +live scope has finished executing. =item C diff --git a/pp_ctl.c b/pp_ctl.c index 272f506..3cda644 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -2866,7 +2866,7 @@ S_doeval(pTHX_ int gimme, OP** startop) CvOUTSIDE(PL_compcv) = (CV*)SvREFCNT_inc(caller); } - SAVEFREESV(PL_compcv); + SAVEMORTALIZESV(PL_compcv); /* must remain until end of current statement */ /* make sure we compile in the right package */ diff --git a/proto.h b/proto.h index c8a59a4..92bb520 100644 --- a/proto.h +++ b/proto.h @@ -676,6 +676,7 @@ PERL_CALLCONV void Perl_save_item(pTHX_ SV* item); PERL_CALLCONV void Perl_save_iv(pTHX_ IV* iv); PERL_CALLCONV void Perl_save_list(pTHX_ SV** sarg, I32 maxsarg); PERL_CALLCONV void Perl_save_long(pTHX_ long* longp); +PERL_CALLCONV void Perl_save_mortalizesv(pTHX_ SV* sv); PERL_CALLCONV void Perl_save_nogv(pTHX_ GV* gv); PERL_CALLCONV void Perl_save_op(pTHX); PERL_CALLCONV SV* Perl_save_scalar(pTHX_ GV* gv); diff --git a/scope.c b/scope.c index 3293c48..31c6f01 100644 --- a/scope.c +++ b/scope.c @@ -504,6 +504,14 @@ Perl_save_freesv(pTHX_ SV *sv) } void +Perl_save_mortalizesv(pTHX_ SV *sv) +{ + SSCHECK(2); + SSPUSHPTR(sv); + SSPUSHINT(SAVEt_MORTALIZESV); +} + +void Perl_save_freeop(pTHX_ OP *o) { SSCHECK(2); @@ -803,6 +811,10 @@ Perl_leave_scope(pTHX_ I32 base) ptr = SSPOPPTR; SvREFCNT_dec((SV*)ptr); break; + case SAVEt_MORTALIZESV: + ptr = SSPOPPTR; + sv_2mortal((SV*)ptr); + break; case SAVEt_FREEOP: ptr = SSPOPPTR; if (PL_comppad) diff --git a/scope.h b/scope.h index 0ceb6ba..edf7ffe 100644 --- a/scope.h +++ b/scope.h @@ -34,6 +34,7 @@ #define SAVEt_COMPPAD 33 #define SAVEt_GENERIC_PVREF 34 #define SAVEt_PADSV 35 +#define SAVEt_MORTALIZESV 36 #ifndef SCOPE_SAVES_SIGNAL_MASK #define SCOPE_SAVES_SIGNAL_MASK 0 @@ -108,6 +109,7 @@ Closing bracket on a callback. See C and L. #define SAVEVPTR(s) save_vptr((void*)&(s)) #define SAVEPADSV(s) save_padsv(s) #define SAVEFREESV(s) save_freesv((SV*)(s)) +#define SAVEMORTALIZESV(s) save_mortalizesv((SV*)(s)) #define SAVEFREEOP(o) save_freeop(SOFT_CAST(OP*)(o)) #define SAVEFREEPV(p) save_freepv(SOFT_CAST(char*)(p)) #define SAVECLEARSV(sv) save_clearsv(SOFT_CAST(SV**)&(sv)) diff --git a/sv.c b/sv.c index e91f1d9..a589e08 100644 --- a/sv.c +++ b/sv.c @@ -8531,6 +8531,7 @@ Perl_ss_dup(pTHX_ PerlInterpreter *proto_perl) TOPIV(nss,ix) = iv; break; case SAVEt_FREESV: + case SAVEt_MORTALIZESV: sv = (SV*)POPPTR(ss,ix); TOPPTR(nss,ix) = sv_dup_inc(sv); break; diff --git a/win32/Makefile b/win32/Makefile index 429569e..f7eda74 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -1038,16 +1038,18 @@ utils: $(PERLEXE) $(X2P) cd ..\pod copy ..\README.aix .\perlaix.pod copy ..\README.amiga .\perlamiga.pod + copy ..\README.bs2000 .\perlbs2000.pod copy ..\README.cygwin .\perlcygwin.pod copy ..\README.dos .\perldos.pod copy ..\README.epoc .\perlepoc.pod copy ..\README.hpux .\perlhpux.pod copy ..\README.machten .\perlmachten.pod + copy ..\README.macos .\perlmacos.pod + copy ..\README.mpeix .\perlmpeix.pod copy ..\README.os2 .\perlos2.pod copy ..\README.os390 .\perlos390.pod - copy ..\README.vmesa .\perlvmesa.pod - copy ..\README.bs2000 .\perlbs2000.pod copy ..\README.solaris .\perlsolaris.pod + copy ..\README.vmesa .\perlvmesa.pod copy ..\vms\perlvms.pod .\perlvms.pod copy ..\README.vos .\perlvos.pod copy ..\README.win32 .\perlwin32.pod @@ -1097,8 +1099,14 @@ distclean: clean -rmdir /s $(LIBDIR)\MIME\Base64 -if exist $(LIBDIR)\MIME rmdir /s /q $(LIBDIR)\MIME -rmdir /s $(LIBDIR)\MIME - -del /f $(PODDIR)\*.html - -del /f $(PODDIR)\*.bat + cd $(PODDIR) + -del /f *.html + -del /f *.bat + -del /f checkpods perlamiga.pod perlcygwin.pod \ + perldos.pod perlhpux.pod perlmachten.pod perlmacos.pod \ + perlmpeix.pod perlos2.pod perlvms.pod \ + perlwin32.pod pod2html pod2latex pod2man pod2text pod2usage \ + podchecker podselect cd ..\utils -del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc dprofpp -del /f *.bat diff --git a/win32/makefile.mk b/win32/makefile.mk index 499453b..5333ce6 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -1085,16 +1085,18 @@ utils: $(PERLEXE) $(X2P) cd ..\utils && $(MAKE) PERL=$(MINIPERL) copy ..\README.aix ..\pod\perlaix.pod copy ..\README.amiga ..\pod\perlamiga.pod + copy ..\README.bs2000 ..\pod\perlbs2000.pod copy ..\README.cygwin ..\pod\perlcygwin.pod copy ..\README.dos ..\pod\perldos.pod copy ..\README.epoc ..\pod\perlepoc.pod copy ..\README.hpux ..\pod\perlhpux.pod copy ..\README.machten ..\pod\perlmachten.pod + copy ..\README.macos ..\pod\perlmacos.pod + copy ..\README.mpeix ..\pod\perlmpeix.pod copy ..\README.os2 ..\pod\perlos2.pod copy ..\README.os390 ..\pod\perlos390.pod + copy ..\README.solaris .\perlsolaris.pod copy ..\README.vmesa ..\pod\perlvmesa.pod - copy ..\README.bs2000 ..\pod\perlbs2000.pod - copy ..\README.solaris ..\pod\perlsolaris.pod copy ..\vms\perlvms.pod ..\pod\perlvms.pod copy ..\README.vos ..\pod\perlvos.pod copy ..\README.win32 ..\pod\perlwin32.pod @@ -1132,8 +1134,11 @@ distclean: clean -if exist $(LIBDIR)\Digest rmdir /s /q $(LIBDIR)\Digest || rmdir /s $(LIBDIR)\Digest -if exist $(LIBDIR)\MIME\Base64 rmdir /s /q $(LIBDIR)\MIME\Base64 || rmdir /s $(LIBDIR)\MIME\Base64 -if exist $(LIBDIR)\MIME rmdir /s /q $(LIBDIR)\MIME || rmdir /s $(LIBDIR)\MIME - -del /f $(PODDIR)\*.html - -del /f $(PODDIR)\*.bat + -cd $(PODDIR) && del /f *.html *.bat checkpods perlamiga.pod \ + perlcygwin.pod perldos.pod perlhpux.pod perlmachten.pod \ + perlmacos.pod perlmpeix.pod \ + perlos2.pod perlvms.pod perlwin32.pod pod2html pod2latex \ + pod2man pod2text pod2usage podchecker podselect -cd ..\utils && del /f h2ph splain perlbug pl2pm c2ph h2xs perldoc \ dprofpp *.bat -cd ..\x2p && del /f find2perl s2p *.bat