Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit 18f2621

Browse files
committed
ExtUtils-Constant: Update to 0.23_08
Minor C code improvements for croak_on_read, tested with -Wall -Wextra: Correct MGVTBL for all versions, get_missing_hash not needed.
1 parent 70cf892 commit 18f2621

File tree

11 files changed

+50
-31
lines changed

11 files changed

+50
-31
lines changed

Porting/Maintainers.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ package Maintainers;
617617

618618
'ExtUtils::Constant' => {
619619
# Upstream broken
620-
'DISTRIBUTION' => 'RURBAN/ExtUtils-Constant-0.23_07.tar.gz',
620+
'DISTRIBUTION' => 'RURBAN/ExtUtils-Constant-0.23_08.tar.gz',
621621
'FILES' => q[dist/ExtUtils-Constant],
622622
'EXCLUDED' => [
623623
qw( lib/ExtUtils/Constant/Aaargh56Hash.pm

dist/ExtUtils-Constant/Changes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,3 +104,13 @@ history can be found via http://perl5.git.perl.org/perl.git/tree/HEAD:/lib ]
104104
Fixed PROXYSUBS with all options but croak_on_read.
105105
Only one 5.6 PROXYSUBS autoload limitation in the error message
106106
on undefined macros.
107+
108+
0.23_07 2017-04-24 rurban
109+
Add benchmarking code and results. Recommended is PROXYSUBS or
110+
PROXYSUBS autoload.
111+
Silence cperl-only Used once warnings with PROXYSUBS push
112+
113+
0.23_08 2017-04-25 rurban
114+
Minor C code improvements for croak_on_read, tested with -Wall -Wextra:
115+
Correct MGVTBL for all versions, get_missing_hash not needed.
116+

dist/ExtUtils-Constant/README

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ use branch tables making the initial switch statements more efficient, and
3838
choosing a switch strategy to minimise the amount of linear searching of
3939
similar constant names.
4040

41-
The best option seems to be PROXYSUBS without options, with the highest speed
42-
and on the lower side of memory usage.
43-
With a lot of macros, memory and speed is still not comparable to
44-
specialized perfect hashes, such as XSConfig or Win32::GUI::Constants
45-
though, but it is good enough for POSIX or Sockets.
41+
The best options seem to be PROXYSUBS or PROXYSUB autoload, with the
42+
highest speed and on the lower side of memory usage. With a lot of
43+
macros, memory and speed is still not comparable to specialized
44+
perfect hashes, such as XSConfig or Win32::GUI::Constants though, but
45+
it is good enough for POSIX or Sockets.
4646

4747
I believe ExtUtils::Constant is completely Unicode safe, but as a consequence
4848
of running various pathological cases as regression tests, the tests will

dist/ExtUtils-Constant/lib/ExtUtils/Constant.pm

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package ExtUtils::Constant;
22
use vars qw (@ISA $VERSION @EXPORT_OK %EXPORT_TAGS);
3-
$VERSION = '0.23_07';
3+
$VERSION = '0.23_08';
44
$VERSION = eval $VERSION;
55

66
=head1 NAME
@@ -621,23 +621,21 @@ PROXYSUBS autoload is the slowest, but easiest to use.
621621
622622
The old method without PROXYSUBS uses the most memory and is 2nd slowest.
623623
624-
But with >500 constants the picture changes, with PROXYSUBS alone being
625-
the slowest, and PROXYSUBS autoload together with no options being the fastest,
626-
whilst with no options still using by far the most memory.
624+
With >500 constants:
627625
628626
Option Memory [b] Time [s]
629627
<none> 2572650 0.025867
630-
PROXYSUBS 2145701 0.032594
631-
PROXYSUBS autoload 2133418 0.025888
632-
PROXYSUBS push 2173807 0.037089
628+
PROXYSUBS 2145701 0.024928
629+
PROXYSUBS autoload 2133418 0.024154
630+
PROXYSUBS push 2173807 0.030029
633631
PROXYSUBS
634-
croak_on_error 2142773 0.026721
632+
croak_on_error 2142773 0.025776
635633
PROXYSUBS
636-
croak_on_read 2145648 0.027261
634+
croak_on_read 2144780 0.027649
637635
PROXYSUBS
638-
autoload push 2161453 0.026756
636+
autoload push 2161453 0.026092
639637
PROXYSUBS
640-
croak_on_error push 2170791 0.026831
638+
croak_on_error push 2170791 0.027433
641639
642640
There are no numbers compared to perfect hashes yet. The estimation is
643641
that EU-C is ~50% slower and bigger, as seen with L<Win32::GUI::Constants>

dist/ExtUtils-Constant/lib/ExtUtils/Constant/Base.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use vars qw($VERSION);
55
use Carp;
66
use Text::Wrap;
77
use ExtUtils::Constant::Utils qw(C_stringify perl_stringify);
8-
$VERSION = '0.23_07';
8+
$VERSION = '0.23_08';
99

1010
use constant is_perl56 => ($] < 5.007 && $] > 5.005_50);
1111

dist/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use strict;
33
use vars qw($VERSION @ISA %type_to_struct %type_from_struct %type_to_sv
44
%type_to_C_value %type_is_a_problem %type_num_args
55
%type_temporary);
6-
$VERSION = '0.23_07';
6+
$VERSION = '0.23_08';
77
@ISA = 'ExtUtils::Constant::XS';
88

99
=head1 NAME
@@ -443,8 +443,13 @@ static MGVTBL not_defined_vtbl = {
443443
0, /* len */
444444
0, /* clear */
445445
0, /* free */
446+
#if PERL_VERSION > 6
446447
0, /* copy */
447448
0, /* dup */
449+
#if (PERL_VERSION > 8) || (PERL_VERSION == 8 && PERL_SUBVERSION == 9)
450+
0, /* local */
451+
#endif
452+
#endif
448453
};
449454
450455
EXPLODE
@@ -456,7 +461,7 @@ EXPLODE
456461
$key =~ s/::$//;
457462
my $key_len = length $key;
458463

459-
print $c_fh <<"MISSING";
464+
print $c_fh <<"MISSING" unless $explosives;
460465
461466
#ifndef SYMBIAN
462467
@@ -589,11 +594,17 @@ EOBOOT
589594
$add_symbol_subname, $push);
590595
}
591596

592-
print $xs_fh <<"EOBOOT";
597+
print $xs_fh <<'EOBOOT';
593598
if (C_ARRAY_LENGTH(values_for_notfound) > 1) {
599+
EOBOOT
600+
601+
print $xs_fh <<"EOBOOT" unless $explosives;
594602
#ifndef SYMBIAN
595603
HV *const ${c_subname}_missing = get_missing_hash(aTHX);
596604
#endif
605+
EOBOOT
606+
607+
print $xs_fh <<'EOBOOT';
597608
const struct notfound_s *value_for_notfound = values_for_notfound;
598609
do {
599610
EOBOOT
@@ -603,7 +614,7 @@ EOBOOT
603614
604615
sv_magicext(tripwire, 0, PERL_MAGIC_ext, &not_defined_vtbl, 0, 0);
605616
SvPV_set(tripwire, (char *)value_for_notfound->name);
606-
if(value_for_notfound->namelen >= 0) {
617+
if (value_for_notfound->namelen >= 0) {
607618
SvCUR_set(tripwire, value_for_notfound->namelen);
608619
} else {
609620
SvCUR_set(tripwire, -value_for_notfound->namelen);

dist/ExtUtils-Constant/lib/ExtUtils/Constant/Utils.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use Carp;
66

77
@ISA = 'Exporter';
88
@EXPORT_OK = qw(C_stringify perl_stringify);
9-
$VERSION = '0.23_07';
9+
$VERSION = '0.23_08';
1010

1111
use constant is_perl55 => ($] < 5.005_50);
1212
use constant is_perl56 => ($] < 5.007 && $] > 5.005_50);

dist/ExtUtils-Constant/lib/ExtUtils/Constant/XS.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require ExtUtils::Constant::Base;
1010
@ISA = qw(ExtUtils::Constant::Base Exporter);
1111
@EXPORT_OK = qw(%XS_Constant %XS_TypeSet);
1212

13-
$VERSION = '0.23_07';
13+
$VERSION = '0.23_08';
1414

1515
$is_perl56 = ($] < 5.007 && $] > 5.005_50);
1616

dist/Module-CoreList/lib/Module/CoreList.pm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14743,11 +14743,11 @@ our %delta = (
1474314743
'CPAN::Distribution' => '2.18_01',
1474414744
'Cpanel::JSON::XS' => '3.0231',
1474514745
'Cwd' => '4.67c',
14746-
'ExtUtils::Constant' => '2.23_07',
14747-
'ExtUtils::Constant::Base' => '2.23_07',
14748-
'ExtUtils::Constant::ProxySubs' => '2.23_07',
14749-
'ExtUtils::Constant::Utils' => '2.23_07',
14750-
'ExtUtils::Constant::XS' => '2.23_07',
14746+
'ExtUtils::Constant' => '2.23_08',
14747+
'ExtUtils::Constant::Base' => '2.23_08',
14748+
'ExtUtils::Constant::ProxySubs' => '2.23_08',
14749+
'ExtUtils::Constant::Utils' => '2.23_08',
14750+
'ExtUtils::Constant::XS' => '2.23_08',
1475114751
'ExtUtils::Install' => '2.04_01',
1475214752
'ExtUtils::ParseXS' => '3.34_02',
1475314753
'ExtUtils::ParseXS::Constants' => '3.34_02',

pod/perlcdelta.pod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1208,7 +1208,7 @@ warnings has been to restricted to the four magic names "EXPORT",
12081208
with "EXPORT" will now throw the "used only once" warning as all other
12091209
symbols.
12101210

1211-
=item ExtUtils-Constant 0.23_07
1211+
=item ExtUtils-Constant 0.23_08
12121212

12131213
Fix ProxySubs to generate code also valid for 5.6 - 5.14.
12141214
Add testcases for all ProxySubs options.

0 commit comments

Comments
 (0)