develooper Front page | perl.perl5.porters | Postings from November 1999

[PATCH 5.005_62] XSLoader.pm

Thread Next
From:
Ilya Zakharevich
Date:
November 15, 1999 22:50
Subject:
[PATCH 5.005_62] XSLoader.pm
Message ID:
199911160650.BAA18874@monk.mps.ohio-state.edu
This patch adds a new module XSLoader.pm to the distribution.  All modules
(except IPC::SysV, which is doing something strange) in the distribution
made use it instead of DynaLoader.

The memory savings for "large" modules (which would include AutoLoader
anyway) is circa 20K.  For small modules (which include AutoLoader via
DynaLoader only) the memory savings should be circa 70K.  Say, this
decreases heap usage of perl -Mattrs from 170K to 95K.

The name of *actually added* file is ext/DynaLoader/XSLoader_pm.PL.

Tested with both dynamic and static linking.  I might have broken
VMS build (cannot understand what it is trying to do), can somebody
check it?

Enjoy,
Ilya

P.S.  Note that localization-with-goto gotchas does not allow a clean
      transfer of control to DynaLoader if XSLoader fails.  The
      handling would be much easier if localization persisted until
      return from a callee (though my tests show correct messages from
      DynaLoader - probably Carp is trying to compensate for
      discrepancies).

P.P.S. Should not "Bizarre copy of ARRAY in aassign in Carp/Heavy.pm"
       be fixed already?  I'm getting it now in some tests where
       dynaloading should fail...

diff -pru perl5.005_62/ext/attrs/attrs.pm perl5.005_62.my/ext/attrs/attrs.pm
--- perl5.005_62/ext/attrs/attrs.pm	Fri Oct  1 21:08:26 1999
+++ perl5.005_62.my/ext/attrs/attrs.pm	Tue Nov 16 00:18:30 1999
@@ -1,10 +1,7 @@
 package attrs;
-require DynaLoader;
-use vars '@ISA';
-@ISA = 'DynaLoader';
+use XSLoader ();
 
-use vars qw($VERSION);
-$VERSION = "1.0";
+$VERSION = $VERSION = "1.0";
 
 =head1 NAME
 
@@ -56,6 +53,6 @@ subroutine is entered.
 
 =cut
 
-bootstrap attrs $VERSION;
+XSLoader::load 'attrs', $VERSION;
 
 1;
diff -pru perl5.005_62/ext/B/B.pm perl5.005_62.my/ext/B/B.pm
--- perl5.005_62/ext/B/B.pm	Sun Sep 12 12:02:20 1999
+++ perl5.005_62.my/ext/B/B.pm	Tue Nov 16 00:07:12 1999
@@ -6,9 +6,9 @@
 #      License or the Artistic License, as specified in the README file.
 #
 package B;
-require DynaLoader;
+use XSLoader ();
 require Exporter;
-@ISA = qw(Exporter DynaLoader);
+@ISA = qw(Exporter);
 @EXPORT_OK = qw(minus_c ppname
 		class peekop cast_I32 cstring cchar hash threadsv_names
 		main_root main_start main_cv svref_2object opnumber amagic_generation
@@ -259,7 +259,7 @@ sub walksymtable {
     }
 }
 
-bootstrap B;
+XSLoader::load 'B';
 
 1;
 
diff -pru perl5.005_62/ext/ByteLoader/ByteLoader.pm perl5.005_62.my/ext/ByteLoader/ByteLoader.pm
--- perl5.005_62/ext/ByteLoader/ByteLoader.pm	Tue Jul 20 12:17:54 1999
+++ perl5.005_62.my/ext/ByteLoader/ByteLoader.pm	Tue Nov 16 00:05:58 1999
@@ -1,12 +1,10 @@
 package ByteLoader;
 
-require DynaLoader;
-
-@ISA = qw(DynaLoader);
+use XSLoader ();
 
 $VERSION = 0.03;
 
-bootstrap ByteLoader $VERSION;
+XSLoader::load 'ByteLoader', $VERSION;
 
 # Preloaded methods go here.
 
diff -pru perl5.005_62/ext/Data/Dumper/Dumper.pm perl5.005_62.my/ext/Data/Dumper/Dumper.pm
--- perl5.005_62/ext/Data/Dumper/Dumper.pm	Wed Sep  8 15:48:12 1999
+++ perl5.005_62.my/ext/Data/Dumper/Dumper.pm	Tue Nov 16 00:17:50 1999
@@ -15,16 +15,16 @@ $VERSION = $VERSION = '2.101';
 
 require 5.004_02;
 require Exporter;
-require DynaLoader;
+use XSLoader ();
 require overload;
 
 use Carp;
 
-@ISA = qw(Exporter DynaLoader);
+@ISA = qw(Exporter);
 @EXPORT = qw(Dumper);
 @EXPORT_OK = qw(DumperX);
 
-bootstrap Data::Dumper;
+XSLoader::load 'Data::Dumper';
 
 # module vars and their defaults
 $Indent = 2 unless defined $Indent;
diff -pru perl5.005_62/ext/DB_File/DB_File.pm perl5.005_62.my/ext/DB_File/DB_File.pm
--- perl5.005_62/ext/DB_File/DB_File.pm	Tue Sep 14 01:45:16 1999
+++ perl5.005_62.my/ext/DB_File/DB_File.pm	Tue Nov 16 00:05:04 1999
@@ -155,8 +155,8 @@ $DB_RECNO = new DB_File::RECNOINFO ;
 require Tie::Hash;
 require Exporter;
 use AutoLoader;
-require DynaLoader;
-@ISA = qw(Tie::Hash Exporter DynaLoader);
+use XSLoader ();
+@ISA = qw(Tie::Hash Exporter);
 @EXPORT = qw(
         $DB_BTREE $DB_HASH $DB_RECNO 
 
@@ -231,7 +231,7 @@ eval {
 #    };
 #}
 
-bootstrap DB_File $VERSION;
+XSLoader::load 'DB_File', $VERSION;
 
 # Preloaded methods go here.  Autoload methods go after __END__, and are
 # processed by the autosplit program.
diff -pru perl5.005_62/ext/Devel/DProf/DProf.pm perl5.005_62.my/ext/Devel/DProf/DProf.pm
--- perl5.005_62/ext/Devel/DProf/DProf.pm	Tue Jul 20 12:17:54 1999
+++ perl5.005_62.my/ext/Devel/DProf/DProf.pm	Tue Nov 16 00:17:20 1999
@@ -182,11 +182,11 @@ sub DB { 
 #	print "nonXS DBDB\n";
 }
 
-require DynaLoader;
-@Devel::DProf::ISA = 'DynaLoader';
+use XSLoader ();
+
 $Devel::DProf::VERSION = '19990108'; # this version not authorized by
 				     # Dean Roehrich. See "Changes" file.
 
-bootstrap Devel::DProf $Devel::DProf::VERSION;
+XSLoader::load 'Devel::DProf', $Devel::DProf::VERSION;
 
 1;
diff -pru perl5.005_62/ext/Devel/Peek/Peek.pm perl5.005_62.my/ext/Devel/Peek/Peek.pm
--- perl5.005_62/ext/Devel/Peek/Peek.pm	Tue Jul 20 12:17:54 1999
+++ perl5.005_62.my/ext/Devel/Peek/Peek.pm	Tue Nov 16 00:03:28 1999
@@ -6,14 +6,14 @@ package Devel::Peek;
 $VERSION = $VERSION = 0.95;
 
 require Exporter;
-require DynaLoader;
+use XSLoader ();
 
-@ISA = qw(Exporter DynaLoader);
+@ISA = qw(Exporter);
 @EXPORT = qw(Dump mstat DeadCode DumpArray DumpWithOP DumpProg);
 @EXPORT_OK = qw(SvREFCNT SvREFCNT_inc SvREFCNT_dec);
 %EXPORT_TAGS = ('ALL' => [@EXPORT, @EXPORT_OK]);
 
-bootstrap Devel::Peek;
+XSLoader::load 'Devel::Peek';
 
 sub DumpWithOP ($;$) {
    local($Devel::Peek::dump_ops)=1;
diff -pru perl5.005_62/ext/DynaLoader/DynaLoader_pm.PL perl5.005_62.my/ext/DynaLoader/DynaLoader_pm.PL
--- perl5.005_62/ext/DynaLoader/DynaLoader_pm.PL	Fri Sep 17 15:12:12 1999
+++ perl5.005_62.my/ext/DynaLoader/DynaLoader_pm.PL	Tue Nov 16 01:37:18 1999
@@ -119,6 +119,14 @@ if ($dl_debug) {
 
 sub croak   { require Carp; Carp::croak(@_)   }
 
+sub bootstrap_inherit {
+    my $module = $_[0];
+    local *isa = *{"$module\::ISA"};
+    local @isa = (@isa, 'DynaLoader');
+    # Cannot goto due to delocalization.  Will report errors on a wrong line?
+    bootstrap(@_);
+}
+
 # The bootstrap function cannot be autoloaded (without complications)
 # so we define it here:
 
diff -pru perl5.005_62/ext/DynaLoader/Makefile.PL perl5.005_62.my/ext/DynaLoader/Makefile.PL
--- perl5.005_62/ext/DynaLoader/Makefile.PL	Tue Jul 20 12:17:54 1999
+++ perl5.005_62.my/ext/DynaLoader/Makefile.PL	Mon Nov 15 21:10:54 1999
@@ -8,8 +8,10 @@ WriteMakefile(
     SKIP	=> [qw(dynamic dynamic_lib dynamic_bs)],
     XSPROTOARG => '-noprototypes', 		# XXX remove later?
     VERSION_FROM => 'DynaLoader_pm.PL',
-    PL_FILES	=> {'DynaLoader_pm.PL'=>'DynaLoader.pm'},
-    PM		=> {'DynaLoader.pm' => '$(INST_LIBDIR)/DynaLoader.pm'},
+    PL_FILES	=> {'DynaLoader_pm.PL'=>'DynaLoader.pm',
+		    'XSLoader_pm.PL'=>'XSLoader.pm'},
+    PM		=> {'DynaLoader.pm' => '$(INST_LIBDIR)/DynaLoader.pm',
+		    'XSLoader.pm' => '$(INST_LIBDIR)/XSLoader.pm'},
     clean	=> {FILES => 'DynaLoader.c DynaLoader.xs DynaLoader.pm'},
 );
 
diff -pru perl5.005_62/ext/DynaLoader/XSLoader_pm.PL perl5.005_62.my/ext/DynaLoader/XSLoader_pm.PL
--- perl5.005_62/ext/DynaLoader/XSLoader_pm.PL	Tue Nov 16 00:37:04 1999
+++ perl5.005_62.my/ext/DynaLoader/XSLoader_pm.PL	Mon Nov 15 23:37:12 1999
@@ -0,0 +1,158 @@
+use Config;
+
+sub to_string {
+    my ($value) = @_;
+    $value =~ s/\\/\\\\'/g;
+    $value =~ s/'/\\'/g;
+    return "'$value'";
+}
+
+unlink "XSLoader.pm" if -f "XSLoader.pm";
+open OUT, ">XSLoader.pm" or die $!;
+print OUT <<'EOT';
+# Generated from XSLoader.pm.PL (resolved %Config::Config value)
+
+package XSLoader;
+
+#   And Gandalf said: 'Many folk like to know beforehand what is to
+#   be set on the table; but those who have laboured to prepare the
+#   feast like to keep their secret; for wonder makes the words of
+#   praise louder.'
+
+#   (Quote from Tolkien sugested by Anno Siegel.)
+#
+# See pod text at end of file for documentation.
+# See also ext/DynaLoader/README in source tree for other information.
+#
+# Tim.Bunce@ig.co.uk, August 1994
+
+$VERSION = $VERSION = "0.01";	# avoid typo warning
+
+# enable debug/trace messages from DynaLoader perl code
+# $dl_debug = $ENV{PERL_DL_DEBUG} || 0 unless defined $dl_debug;
+
+EOT
+
+print OUT '  my $dl_dlext = ', to_string($Config::Config{'dlext'}), ";\n" ;
+
+print OUT <<'EOT';
+
+# No prizes for guessing why we don't say 'bootstrap DynaLoader;' here.
+package DynaLoader;
+boot_DynaLoader('DynaLoader') if defined(&boot_DynaLoader) &&
+                                !defined(&dl_load_file);
+package XSLoader;
+
+1; # End of main code
+
+# The bootstrap function cannot be autoloaded (without complications)
+# so we define it here:
+
+sub load {
+    package DynaLoader;
+
+    my($module) = $_[0];
+
+    # work with static linking too
+    my $b = "$module\::bootstrap";
+    goto &$b if defined &$b;
+
+    goto retry unless $module and defined &dl_load_file;
+
+    my @modparts = split(/::/,$module);
+    my $modfname = $modparts[-1];
+
+EOT
+
+print OUT <<'EOT' if defined &DynaLoader::mod2fname;
+    # Some systems have restrictions on files names for DLL's etc.
+    # mod2fname returns appropriate file base name (typically truncated)
+    # It may also edit @modparts if required.
+    $modfname = &mod2fname(\@modparts) if defined &mod2fname;
+
+EOT
+
+print OUT <<'EOT';
+    my $modpname = join('/',@modparts);
+    my $modlibname = (caller())[1];
+    my $c = @modparts;
+    $modlibname =~ s,[\\/][^\\/]+$,, while $c--;	# Q&D basename
+    my $file = "$modlibname/auto/$modpname/$modfname.$dl_dlext";
+
+#   print STDERR "XSLoader::load for $module ($file)\n" if $dl_debug;
+
+    my $bs = $file;
+    $bs =~ s/(\.\w+)?(;\d*)?$/\.bs/; # look for .bs 'beside' the library
+
+    goto retry if not -f $file or -s $bs;
+
+    my $bootname = "boot_$module";
+    $bootname =~ s/\W/_/g;
+    @dl_require_symbols = ($bootname);
+
+    # Many dynamic extension loading problems will appear to come from
+    # this section of code: XYZ failed at line 123 of DynaLoader.pm.
+    # Often these errors are actually occurring in the initialisation
+    # C code of the extension XS file. Perl reports the error as being
+    # in this perl code simply because this was the last perl code
+    # it executed.
+
+    my $libref = dl_load_file($file, 0) or do { 
+	require Carp;
+	Carp::croak("Can't load '$file' for module $module: " . dl_error());
+    };
+    push(@dl_librefs,$libref);  # record loaded object
+
+    my @unresolved = dl_undef_symbols();
+    if (@unresolved) {
+	require Carp;
+	Carp::carp("Undefined symbols present after loading $file: @unresolved\n");
+    }
+
+    my $boot_symbol_ref = dl_find_symbol($libref, $bootname) or do {
+	require Carp;
+	Carp::croak("Can't find '$bootname' symbol in $file\n");
+    };
+
+    my $xs = dl_install_xsub("${module}::bootstrap", $boot_symbol_ref, $file);
+
+    push(@dl_modules, $module); # record loaded module
+
+    # See comment block above
+    return &$xs(@_);
+
+  retry:
+    require DynaLoader;
+    goto &DynaLoader::bootstrap_inherit;
+}
+
+__END__
+
+=head1 NAME
+
+XSLoader - Dynamically load C libraries into Perl code
+
+=head1 SYNOPSIS
+
+    package YourPackage;
+    use XSLoader;
+
+    XSLoader::load 'YourPackage', @args;
+
+=head1 DESCRIPTION
+
+This module defines a standard I<simplified> interface to the dynamic
+linking mechanisms available on many platforms.  Its primary purpose is
+to implement cheap automatic dynamic loading of Perl modules.
+
+For more complicated interface see L<DynaLoader>.
+
+=head1 AUTHOR
+
+Ilya Zakharevich: extraction from DynaLoader.
+
+=cut
+EOT
+
+close OUT or die $!;
+
diff -pru perl5.005_62/ext/Fcntl/Fcntl.pm perl5.005_62.my/ext/Fcntl/Fcntl.pm
--- perl5.005_62/ext/Fcntl/Fcntl.pm	Fri Aug 20 10:51:30 1999
+++ perl5.005_62.my/ext/Fcntl/Fcntl.pm	Tue Nov 16 00:02:56 1999
@@ -45,8 +45,8 @@ what constants are implemented in your s
 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD);
 
 require Exporter;
-require DynaLoader;
-@ISA = qw(Exporter DynaLoader);
+use XSLoader ();
+@ISA = qw(Exporter);
 $VERSION = "1.03";
 # Items to export into callers namespace by default
 # (move infrequently used names to @EXPORT_OK below)
@@ -159,6 +159,6 @@ sub AUTOLOAD {
     goto &$AUTOLOAD;
 }
 
-bootstrap Fcntl $VERSION;
+XSLoader::load 'Fcntl', $VERSION;
 
 1;
diff -pru perl5.005_62/ext/File/Glob/Glob.pm perl5.005_62.my/ext/File/Glob/Glob.pm
--- perl5.005_62/ext/File/Glob/Glob.pm	Fri Oct 15 03:06:22 1999
+++ perl5.005_62.my/ext/File/Glob/Glob.pm	Tue Nov 16 00:02:28 1999
@@ -5,10 +5,10 @@ use Carp;
 use vars qw($VERSION @ISA @EXPORT_OK @EXPORT_FAIL %EXPORT_TAGS $AUTOLOAD);
 
 require Exporter;
-require DynaLoader;
+use XSLoader ();
 require AutoLoader;
 
-@ISA = qw(Exporter DynaLoader AutoLoader);
+@ISA = qw(Exporter AutoLoader);
 
 @EXPORT_OK   = qw(
     globally
@@ -83,7 +83,7 @@ sub AUTOLOAD {
     goto &$AUTOLOAD;
 }
 
-bootstrap File::Glob $VERSION;
+XSLoader::load 'File::Glob', $VERSION;
 
 # Preloaded methods go here.
 
diff -pru perl5.005_62/ext/GDBM_File/GDBM_File.pm perl5.005_62.my/ext/GDBM_File/GDBM_File.pm
--- perl5.005_62/ext/GDBM_File/GDBM_File.pm	Sun Jul 25 21:47:50 1999
+++ perl5.005_62.my/ext/GDBM_File/GDBM_File.pm	Tue Nov 16 00:01:24 1999
@@ -46,8 +46,8 @@ require Carp;
 require Tie::Hash;
 require Exporter;
 use AutoLoader;
-require DynaLoader;
-@ISA = qw(Tie::Hash Exporter DynaLoader);
+use XSLoader ();
+@ISA = qw(Tie::Hash Exporter);
 @EXPORT = qw(
 	GDBM_CACHESIZE
 	GDBM_FAST
@@ -78,7 +78,7 @@ sub AUTOLOAD {
     goto &$AUTOLOAD;
 }
 
-bootstrap GDBM_File $VERSION;
+XSLoader::load 'GDBM_File', $VERSION;
 
 # Preloaded methods go here.  Autoload methods go after __END__, and are
 # processed by the autosplit program.
diff -pru perl5.005_62/ext/IO/IO.pm perl5.005_62.my/ext/IO/IO.pm
--- perl5.005_62/ext/IO/IO.pm	Tue Jul 20 12:17:54 1999
+++ perl5.005_62.my/ext/IO/IO.pm	Tue Nov 16 00:16:06 1999
@@ -2,15 +2,11 @@
 
 package IO;
 
-require DynaLoader;
-require Exporter;
+use XSLoader ();
 use Carp;
 
-use vars qw(@ISA $VERSION @EXPORT);
-
-@ISA = qw(DynaLoader);
-$VERSION = "1.20";
-bootstrap IO $VERSION;
+$VERSION = $VERSION = "1.20";
+XSLoader::load 'IO', $VERSION;
 
 sub import {
     shift;
diff -pru perl5.005_62/ext/NDBM_File/NDBM_File.pm perl5.005_62.my/ext/NDBM_File/NDBM_File.pm
--- perl5.005_62/ext/NDBM_File/NDBM_File.pm	Tue Jul 20 12:17:56 1999
+++ perl5.005_62.my/ext/NDBM_File/NDBM_File.pm	Tue Nov 16 00:00:02 1999
@@ -8,13 +8,13 @@ BEGIN {
 use vars qw($VERSION @ISA); 
 
 require Tie::Hash;
-require DynaLoader;
+use DynaLoader ();
 
-@ISA = qw(Tie::Hash DynaLoader);
+@ISA = qw(Tie::Hash);
 
 $VERSION = "1.03";
 
-bootstrap NDBM_File $VERSION;
+XSLoader::load 'NDBM_File', $VERSION;
 
 1;
 
diff -pru perl5.005_62/ext/ODBM_File/ODBM_File.pm perl5.005_62.my/ext/ODBM_File/ODBM_File.pm
--- perl5.005_62/ext/ODBM_File/ODBM_File.pm	Tue Jul 20 12:17:56 1999
+++ perl5.005_62.my/ext/ODBM_File/ODBM_File.pm	Mon Nov 15 23:59:40 1999
@@ -4,13 +4,13 @@ use strict;
 use vars qw($VERSION @ISA);
 
 require Tie::Hash;
-require DynaLoader;
+use DynaLoader ();
 
-@ISA = qw(Tie::Hash DynaLoader);
+@ISA = qw(Tie::Hash);
 
 $VERSION = "1.02";
 
-bootstrap ODBM_File $VERSION;
+XSLoader::load 'ODBM_File', $VERSION;
 
 1;
 
diff -pru perl5.005_62/ext/Opcode/Opcode.pm perl5.005_62.my/ext/Opcode/Opcode.pm
--- perl5.005_62/ext/Opcode/Opcode.pm	Sun Sep  5 15:06:50 1999
+++ perl5.005_62.my/ext/Opcode/Opcode.pm	Mon Nov 15 23:59:06 1999
@@ -10,8 +10,8 @@ $XS_VERSION = "1.03";
 use strict;
 use Carp;
 use Exporter ();
-use DynaLoader ();
-@ISA = qw(Exporter DynaLoader);
+use XSLoader ();
+@ISA = qw(Exporter);
 
 BEGIN {
     @EXPORT_OK = qw(
@@ -28,7 +28,7 @@ sub opset_to_hex ($);
 sub opdump (;$);
 use subs @EXPORT_OK;
 
-bootstrap Opcode $XS_VERSION;
+XSLoader::load 'Opcode', $XS_VERSION;
 
 _init_optags();
 
diff -pru perl5.005_62/ext/POSIX/POSIX.pm perl5.005_62.my/ext/POSIX/POSIX.pm
--- perl5.005_62/ext/POSIX/POSIX.pm	Tue Jul 27 03:58:22 1999
+++ perl5.005_62.my/ext/POSIX/POSIX.pm	Tue Nov 16 00:13:44 1999
@@ -9,8 +9,8 @@ require Config;
 use Symbol;
 
 require Exporter;
-require DynaLoader;
-@ISA = qw(Exporter DynaLoader);
+use XSLoader ();
+@ISA = qw(Exporter);
 
 $VERSION = $VERSION = "1.03" ;
 
@@ -195,7 +195,7 @@ sub import {
 }
 
 
-bootstrap POSIX $VERSION;
+XSLoader::load 'POSIX', $VERSION;
 
 my $EINVAL = constant("EINVAL", 0);
 my $EAGAIN = constant("EAGAIN", 0);
diff -pru perl5.005_62/ext/re/re.pm perl5.005_62.my/ext/re/re.pm
--- perl5.005_62/ext/re/re.pm	Tue Jul 20 12:17:56 1999
+++ perl5.005_62.my/ext/re/re.pm	Mon Nov 15 23:57:42 1999
@@ -105,9 +105,8 @@ sub bits {
     foreach my $s (@_){
       if ($s eq 'debug' or $s eq 'debugcolor') {
  	  setcolor() if $s eq 'debugcolor';
-	  require DynaLoader;
-	  @ISA = ('DynaLoader');
-	  bootstrap re;
+	  require XSLoader;
+	  XSLoader::load('re');
 	  install() if $on;
 	  uninstall() unless $on;
 	  next;
diff -pru perl5.005_62/ext/SDBM_File/SDBM_File.pm perl5.005_62.my/ext/SDBM_File/SDBM_File.pm
--- perl5.005_62/ext/SDBM_File/SDBM_File.pm	Tue Jul 20 12:17:56 1999
+++ perl5.005_62.my/ext/SDBM_File/SDBM_File.pm	Tue Nov 16 00:13:30 1999
@@ -4,13 +4,13 @@ use strict;
 use vars qw($VERSION @ISA);
 
 require Tie::Hash;
-require DynaLoader;
+use XSLoader ();
 
-@ISA = qw(Tie::Hash DynaLoader);
+@ISA = qw(Tie::Hash);
 
 $VERSION = "1.02" ;
 
-bootstrap SDBM_File $VERSION;
+XSLoader::load 'SDBM_File', $VERSION;
 
 1;
 
diff -pru perl5.005_62/ext/Socket/Socket.pm perl5.005_62.my/ext/Socket/Socket.pm
--- perl5.005_62/ext/Socket/Socket.pm	Tue Jul 20 12:17:56 1999
+++ perl5.005_62.my/ext/Socket/Socket.pm	Tue Nov 16 00:13:22 1999
@@ -162,8 +162,8 @@ have AF_UNIX in the right place.
 use Carp;
 
 require Exporter;
-require DynaLoader;
-@ISA = qw(Exporter DynaLoader);
+use XSLoader ();
+@ISA = qw(Exporter);
 @EXPORT = qw(
 	inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in
 	pack_sockaddr_un unpack_sockaddr_un
@@ -333,6 +333,6 @@ sub AUTOLOAD {
     goto &$AUTOLOAD;
 }
 
-bootstrap Socket $VERSION;
+XSLoader::load 'Socket', $VERSION;
 
 1;
diff -pru perl5.005_62/ext/Thread/Thread.pm perl5.005_62.my/ext/Thread/Thread.pm
--- perl5.005_62/ext/Thread/Thread.pm	Sat Oct  9 22:31:02 1999
+++ perl5.005_62.my/ext/Thread/Thread.pm	Tue Nov 16 00:13:02 1999
@@ -1,11 +1,11 @@
 package Thread;
 require Exporter;
-require DynaLoader;
+use XSLoader ();
 use vars qw($VERSION @ISA @EXPORT);
 
 $VERSION = "1.0";
 
-@ISA = qw(Exporter DynaLoader);
+@ISA = qw(Exporter);
 @EXPORT_OK = qw(yield cond_signal cond_broadcast cond_wait async);
 
 =head1 NAME
@@ -204,6 +204,6 @@ sub eval {
     return eval { shift->join; };
 }
 
-bootstrap Thread;
+XSLoader::load 'Thread';
 
 1;
--- perl5.005_62/MANIFEST	Fri Oct 15 04:53:58 1999
+++ perl5.005_62.my/MANIFEST	Tue Nov 16 00:31:42 1999
@@ -227,6 +227,7 @@ ext/Devel/Peek/Peek.xs		Data debugging t
 ext/DynaLoader/DynaLoader_pm.PL	Dynamic Loader perl module
 ext/DynaLoader/Makefile.PL	Dynamic Loader makefile writer
 ext/DynaLoader/README		Dynamic Loader notes and intro
+ext/DynaLoader/XSLoader_pm.PL	Simple XS Loader perl module
 ext/DynaLoader/dl_aix.xs	AIX implementation
 ext/DynaLoader/dl_beos.xs	BeOS implementation
 ext/DynaLoader/dl_cygwin.xs	Cygwin implementation

Thread Next


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