diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-07-08 18:47:35 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-07-08 18:47:35 +0000 |
commit | 51371543ca1a75ed152020ad0846b5b8cf11c32f (patch) | |
tree | 9bfd9a21697b0769e2681483631c742642dd8c45 /perly.c | |
parent | 4d61ec052de5c3a91dc64c80c032c2cbec44d845 (diff) | |
download | perl-51371543ca1a75ed152020ad0846b5b8cf11c32f.tar.gz |
more PERL_OBJECT cleanups (changes still untested on Unix!)
p4raw-id: //depot/perl@3660
Diffstat (limited to 'perly.c')
-rw-r--r-- | perly.c | 40 |
1 files changed, 24 insertions, 16 deletions
@@ -16,6 +16,8 @@ static char yysccsid[] = "@(#)yaccpar 1.8 (Berkeley) 01/20/91"; #define dep() deprecate("\"do\" to call subroutines") +static void yydestruct(pTHXo_ void *ptr); + #line 30 "perly.y" #define YYERRCODE 256 static short yylhs[] = { -1, @@ -1316,21 +1318,6 @@ struct ysv { YYSTYPE oldyylval; }; -void -Perl_yydestruct(pTHX_ void *ptr) -{ - struct ysv* ysave = (struct ysv*)ptr; - if (ysave->yyss) Safefree(ysave->yyss); - if (ysave->yyvs) Safefree(ysave->yyvs); - yydebug = ysave->oldyydebug; - yynerrs = ysave->oldyynerrs; - yyerrflag = ysave->oldyyerrflag; - yychar = ysave->oldyychar; - yyval = ysave->oldyyval; - yylval = ysave->oldyylval; - Safefree(ysave); -} - int Perl_yyparse(pTHX) { @@ -1350,7 +1337,7 @@ Perl_yyparse(pTHX) struct ysv *ysave; New(73, ysave, 1, struct ysv); - SAVEDESTRUCTOR(Perl_yydestruct, ysave); + SAVEDESTRUCTOR(yydestruct, ysave); ysave->oldyydebug = yydebug; ysave->oldyynerrs = yynerrs; ysave->oldyyerrflag = yyerrflag; @@ -2384,3 +2371,24 @@ yyabort: yyaccept: return retval; } + + +#ifdef PERL_OBJECT +#define NO_XSLOCKS +#include "XSUB.h" +#endif + +static void +yydestruct(pTHXo_ void *ptr) +{ + struct ysv* ysave = (struct ysv*)ptr; + if (ysave->yyss) Safefree(ysave->yyss); + if (ysave->yyvs) Safefree(ysave->yyvs); + yydebug = ysave->oldyydebug; + yynerrs = ysave->oldyynerrs; + yyerrflag = ysave->oldyyerrflag; + yychar = ysave->oldyychar; + yyval = ysave->oldyyval; + yylval = ysave->oldyylval; + Safefree(ysave); +} |