summaryrefslogtreecommitdiff
path: root/embed.pl
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2000-09-03 21:54:46 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2000-09-03 21:54:46 +0000
commit1c846c1f6d96d2ca4dfccdcfc0ff050c1474993e (patch)
tree052cab67c23c5f42f2f3fbf0d595e76961d271d2 /embed.pl
parent6570e624857a0fc90e8fa87d3479a32bd7482703 (diff)
downloadperl-1c846c1f6d96d2ca4dfccdcfc0ff050c1474993e.tar.gz
Hash lookup of constant strings optimization:
Introduce SvREADONLY && SvFAKE to flag an SV which has SvPVX pointing to string table (as per sharepvn). Add newSV_pvn_share to create such a thing. Make hv.c compare addresses of strings and skip string compare if equal. Make method_named and helem ops use these shared-string SVs when arg is constant. Make keys op return shared-string SVs (less clearly a win). p4raw-id: //depot/perl@7016
Diffstat (limited to 'embed.pl')
-rwxr-xr-xembed.pl45
1 files changed, 23 insertions, 22 deletions
diff --git a/embed.pl b/embed.pl
index b99a59f3cd..c8e83f85ce 100755
--- a/embed.pl
+++ b/embed.pl
@@ -135,12 +135,12 @@ sub write_protos {
}
$ret .= ")";
$ret .= " __attribute__((noreturn))" if $flags =~ /r/;
- if( $flags =~ /f/ ) {
+ if( $flags =~ /f/ ) {
my $prefix = $flags =~ /n/ ? '' : 'pTHX_';
- my $args = scalar @args;
+ my $args = scalar @args;
$ret .= "\n#ifdef CHECK_FORMAT\n";
$ret .= sprintf " __attribute__((format(printf,%s%d,%s%d)))",
- $prefix, $args - 1, $prefix, $args;
+ $prefix, $args - 1, $prefix, $args;
$ret .= "\n#endif\n";
}
$ret .= ";\n";
@@ -185,11 +185,11 @@ EOT
# hints
# copline
my @extvars = qw(sv_undef sv_yes sv_no na dowarn
- curcop compiling
+ curcop compiling
tainting tainted stack_base stack_sp sv_arenaroot
no_modify
curstash DBsub DBsingle debstash
- rsfp
+ rsfp
stdingv
defgv
errgv
@@ -280,7 +280,7 @@ unlink 'embed.h';
open(EM, '> embed.h') or die "Can't create embed.h: $!\n";
print EM <<'END';
-/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
This file is built by embed.pl from data in embed.pl, pp.sym, intrpvar.h,
perlvars.h and thrdvar.h. Any changes made here will be lost!
*/
@@ -542,7 +542,7 @@ open(EM, '> embedvar.h')
or die "Can't create embedvar.h: $!\n";
print EM <<'END';
-/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
This file is built by embed.pl from data in embed.pl, pp.sym, intrpvar.h,
perlvars.h and thrdvar.h. Any changes made here will be lost!
*/
@@ -708,7 +708,7 @@ open(OBX, '> objXSUB.h')
or die "Can't create objXSUB.h: $!\n";
print OBX <<'EOT';
-/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
This file is built by embed.pl from data in embed.pl, pp.sym, intrpvar.h,
perlvars.h and thrdvar.h. Any changes made here will be lost!
*/
@@ -766,7 +766,7 @@ open(CAPI, '> perlapi.c') or die "Can't create perlapi.c: $!\n";
open(CAPIH, '> perlapi.h') or die "Can't create perlapi.h: $!\n";
print CAPIH <<'EOT';
-/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
This file is built by embed.pl from data in embed.pl, pp.sym, intrpvar.h,
perlvars.h and thrdvar.h. Any changes made here will be lost!
*/
@@ -873,7 +873,7 @@ EOT
close CAPIH;
print CAPI <<'EOT';
-/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
+/* !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
This file is built by embed.pl from data in embed.pl, pp.sym, intrpvar.h,
perlvars.h and thrdvar.h. Any changes made here will be lost!
*/
@@ -1132,7 +1132,7 @@ sub docout ($$$) { # output the docs for one function
$docs .= "NOTE: this function is experimental and may change or be
removed without notice.\n\n" if $flags =~ /x/;
- $docs .= "NOTE: the perl_ form of this function is deprecated.\n\n"
+ $docs .= "NOTE: the perl_ form of this function is deprecated.\n\n"
if $flags =~ /p/;
print $fh "=item $name\n$docs";
@@ -1159,7 +1159,7 @@ for $file (glob('*.c'), glob('*.h')) {
}
unlink "pod/perlapi.pod";
-open (DOC, ">pod/perlapi.pod") or
+open (DOC, ">pod/perlapi.pod") or
die "Can't create pod/perlapi.pod: $!\n";
walk_table { # load documented functions into approriate hash
@@ -1184,7 +1184,7 @@ walk_table { # load documented functions into approriate hash
} \*DOC;
for (sort keys %docfuncs) {
- # Have you used a full for apidoc or just a func name?
+ # Have you used a full for apidoc or just a func name?
# Have you used Ap instead of Am in the for apidoc?
warn "Unable to place $_!\n";
}
@@ -1196,9 +1196,9 @@ perlapi - autogenerated documentation for the perl public API
=head1 DESCRIPTION
-This file contains the documentation of the perl public API generated by
-embed.pl, specifically a listing of functions, macros, flags, and variables
-that may be used by extension writers. The interfaces of any functions that
+This file contains the documentation of the perl public API generated by
+embed.pl, specifically a listing of functions, macros, flags, and variables
+that may be used by extension writers. The interfaces of any functions that
are not listed here are subject to change without notice. For this reason,
blindly using functions listed in proto.h is to be avoided when writing
extensions.
@@ -1244,19 +1244,19 @@ _EOE_
close(DOC);
-open(GUTS, ">pod/perlintern.pod") or
+open(GUTS, ">pod/perlintern.pod") or
die "Unable to create pod/perlintern.pod: $!\n";
print GUTS <<'END';
=head1 NAME
-perlintern - autogenerated documentation of purely B<internal>
+perlintern - autogenerated documentation of purely B<internal>
Perl functions
=head1 DESCRIPTION
-This file is the autogenerated documentation of functions in the
+This file is the autogenerated documentation of functions in the
Perl interpreter that are documented using Perl's internal documentation
-format but are not marked as part of the Perl API. In other words,
+format but are not marked as part of the Perl API. In other words,
B<they are not for use in extensions>!
=over 8
@@ -1272,8 +1272,8 @@ print GUTS <<'END';
=head1 AUTHORS
-The autodocumentation system was originally added to the Perl core by
-Benjamin Stuhl. Documentation is by whoever was kind enough to
+The autodocumentation system was originally added to the Perl core by
+Benjamin Stuhl. Documentation is by whoever was kind enough to
document their functions.
=head1 SEE ALSO
@@ -1801,6 +1801,7 @@ Apd |SV* |newSVuv |UV u
Apd |SV* |newSVnv |NV n
Apd |SV* |newSVpv |const char* s|STRLEN len
Apd |SV* |newSVpvn |const char* s|STRLEN len
+Apd |SV* |newSVpvn_share |const char* s|STRLEN len|U32 hash
Afpd |SV* |newSVpvf |const char* pat|...
Ap |SV* |vnewSVpvf |const char* pat|va_list* args
Apd |SV* |newSVrv |SV* rv|const char* classname