develooper Front page | perl.perl5.porters | Postings from February 2003

Re: Change 18725: inline SvREFCNT_dec:

From:
hv
Date:
February 17, 2003 02:18
Subject:
Re: Change 18725: inline SvREFCNT_dec:
Message ID:
200302171020.h1HAKV628658@crypt.compulink.co.uk
Philip Newton <Philip.Newton@gmx.net> wrote:
:On Sun, 16 Feb 2003 06:30:06 -0800, hv@crypt.org (Hv) wrote:
:> +++ perl/embed.h	Sun Feb 16 05:08:52 2003
[...]
:> @@ -1003,6 +1003,8 @@
:>  #define sv_free			Perl_sv_free
:>  #ifdef PERL_CORE
:> +#endif
:> +#ifdef PERL_CORE
:>  #define sv_free_arenas		Perl_sv_free_arenas
[...]
:I presume having "#ifdef PERL_CORE / #endif" with nothing in between
:(twice) makes some sort of strange sense to someone, but the purpose
:eludes me. Can someone enlighten me, please?

1. This file is generated from embed.fnc. This fragment comes from:
  Apd |void   |sv_free    |SV* sv
  po  |void   |sv_free2   |SV* sv
  pd  |void   |sv_free_arenas

2. The #ifdef is wrapped separately around each function definition
that isn't marked 'A'. But 'o' then suppresses the function alias.
I've applied the patch below as #18734 to suppress the #ifdef block
in this case, but we could also consider wrapping the normal alias
definition in a comment to make the derivation clearer.

Hugo
--- embed.pl.old	Mon Feb 17 11:12:27 2003
+++ embed.pl	Mon Feb 17 11:10:34 2003
@@ -344,7 +344,7 @@
 		$ret .= hide($func,"Perl_$func");
 	    }
 	}
-         unless ($flags =~ /A/) {
+	if ($ret ne '' && $flags !~ /A/) {
 	    if ($flags =~ /E/) {
 		$ret = "#if defined(PERL_CORE) || defined(PERL_EXT)\n$ret#endif\n";
 	    } else {



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About