Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
  • 3 commits
  • 3 files changed
  • 0 commit comments
  • 1 contributor
Commits on Apr 04, 2012
@devel-chm devel-chm Implement pdl_do_sys_map() work around sys_map bug
This is a cut and paste of the original File::Map::sys_map
routine with the bug fixed.  It should be possible to strip
down the dependencies more for this routine if desired.
Maybe the File::Map author would be willing to pursue.
305ef32
@devel-chm devel-chm Update Release_Notes with sys_map work-around done! a4e56e6
@devel-chm devel-chm Add File::Map 0.46 as dependency for CPAN Testers
After a checkout by PDL developers, this is planned
to be released as a CPAN Developers release for the
purpose of exercising the new File::Map implementation
of mapflex and mapfraw as an official dependency and
to determine if there are any portability or availability
issues that might need to be addressed.
462d80d
Showing with 22 additions and 28 deletions.
  1. +13 −10 Basic/Core/Core.pm.PL
  2. +1 −0  Makefile.PL
  3. +8 −18 Release_Notes
View
23 Basic/Core/Core.pm.PL
@@ -4022,6 +4022,18 @@ BEGIN {
}
}
+# Implement File::Map::sys_map bug fix. Also, might be possible
+# to implement without so many external (non-Core perl) modules.
+#
+sub pdl_do_sys_map {
+ my (undef, $length, $protection, $flags, $fh, $offset) = @_;
+ my $utf8 = File::Map::_check_layers($fh);
+ my $fd = ($flags & MAP_ANONYMOUS) ? (-1) : fileno($fh);
+ $offset ||= 0;
+ File::Map::_mmap_impl($_[0], $length, $protection, $flags, $fd, $offset, $utf8);
+ return;
+}
+
sub PDL::set_data_by_file_map {
my ($pdl,$name,$len,$shared,$writable,$creat,$mode,$trunc) = @_;
my $pdl_dataref = $pdl->get_dataref();
@@ -4041,17 +4053,8 @@ sub PDL::set_data_by_file_map {
if ($len) {
-# sub sys_map {
-# my (undef, $length, $protection, $flags, $fh, $offset) = @_;
-# my $utf8 = _check_layers($fh);
-# my $fd = ($flags & MAP_ANONYMOUS) ? $ANON_FH : $fh;
-# $offset ||= 0;
-# _mmap_impl($_[0], $length, $protection, $flags, $fd, $offset, $utf8);
-# return;
-# }
-
#eval {
- sys_map( # will croak if the mapping fails
+ pdl_do_sys_map( # will croak if the mapping fails
${$pdl_dataref},
$len,
PROT_READ | ($writable ? PROT_WRITE : 0),
View
1  Makefile.PL
@@ -481,6 +481,7 @@ my @podpms = map { $_.".pod", '$(INST_LIBDIR)/PDL/' . $_ .".pod"}
'Convert::UU' => 0, # for PDL::IO::Dumper
'Data::Dumper' => 2.121, # for PDL::IO::Dumper
'ExtUtils::MakeMaker' => 6.31, # for INSTALL_BASE support
+ 'File::Map' => 0.46, # test new mmap implementation
'File::Spec' => 0.6,
'File::Temp' => 0,
'Filter::Util::Call' => 0, # for PDL::NiceSlice
View
26 Release_Notes
@@ -35,26 +35,16 @@ Highlights:
* mapflex and mapfraw routines for memory-mapped IO have been
refactored to use the File::Map module. The new routines
- should work for all platforms having File::Map installed.
- The new implementation should work for 32- and 64-bit perls
- as well as 64-bit file offsets. Please test and report.
+ should work for all platforms having File::Map version
+ 0.46 or later installed. This new implementation should
+ work for 32- and 64-bit perls as well as with 64-bit file
+ offsets. Please test and report.
- NOTE: There is a known problem in File-Map-0.46 where the
+ NOTE: There is a reported bug in File-Map-0.46 where the
$fd argument is not calculated correctly before calling
- the _mmap_impl() routine. Until a new release of File::Map,
- you can fix the problem by editing the Map.pm file and
- changing line #114 from this:
-
- my $fd = ($flags & MAP_ANONYMOUS) ? $ANON_FH : $fh;
-
- to this (by adding fileno() around the $fh):
-
- my $fd = ($flags & MAP_ANONYMOUS) ? $ANON_FH : fileno($fh);
-
- An already edited version of this file can be found
- in inc/File/Map.pm. The bug has been reported and a
- developers release of PDL with the fixed version as a
- dependency will be released to CPAN for testing.
+ the _mmap_impl() routine. A work-around has been made
+ in our mapflex and mapfraw routines and a fix should be
+ available shortly on CPAN.
* Various cleanup to existing code to fix warnings generated
by perl-5.15.

No commit comments for this range

Something went wrong with that request. Please try again.