The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
Changes 016
MANIFEST 01
META.json 056
META.yml 2626
Makefile.PL 22
Mmap.pm 65
Mmap.xs 214
7 files changed (This is a version diff) 36120
@@ -1,3 +1,19 @@
+Todd Rinaldo August 23 2014 v0.17
+* No changes - version bump for stable release.
+
+Todd Rinaldo August 22 2014 v0.17_01
+* Track fixes in github now all issues are cleared from RT
+  https://github.com/toddr/Sys-Mmap/issues
+* Turn off homepage in META since there really isn't one.
+* Minor fix to COW patch related to XS spacing.
+
+Scott Walters, August 21 2014, v0.17_01
+* RT 91483 - croak("variable is not a string") was hitting because it was being
+  too selective with SV type for modern perls.
+* RT 96043 - Updates to fix perl 5.20 COW issues
+* RT 96043 - Add MAP_LOCKED flag
+* Update contributors docs.
+
 Todd Rinaldo August 19 2011 v0.16
 * Testing looks stable on all major perl versions and distros.
 * Release with only version bump
@@ -9,3 +9,4 @@ Mmap.xs
 README
 t/mmap.t
 t/munmap_errors.t
+META.json                                Module JSON meta-data (added by MakeMaker)
@@ -0,0 +1,56 @@
+{
+   "abstract" : "uses mmap to map in a file as a Perl variable",
+   "author" : [
+      "Scott Walters <swalters@cpan.org>"
+   ],
+   "dynamic_config" : 1,
+   "generated_by" : "ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120921",
+   "license" : [
+      "perl_5"
+   ],
+   "meta-spec" : {
+      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec",
+      "version" : "2"
+   },
+   "name" : "Sys-Mmap",
+   "no_index" : {
+      "directory" : [
+         "t",
+         "inc"
+      ]
+   },
+   "prereqs" : {
+      "build" : {
+         "requires" : {
+            "Errno" : "0",
+            "ExtUtils::MakeMaker" : "0",
+            "Test::More" : "0"
+         }
+      },
+      "configure" : {
+         "requires" : {
+            "ExtUtils::MakeMaker" : "0"
+         }
+      },
+      "runtime" : {
+         "requires" : {
+            "DynaLoader" : "0",
+            "Test::More" : "0",
+            "XSLoader" : "0"
+         }
+      }
+   },
+   "release_status" : "stable",
+   "resources" : {
+      "bugtracker" : {
+         "web" : "https://github.com/toddr/Sys-Mmap/issues"
+      },
+      "license" : [
+         "http://dev.perl.org/licenses/"
+      ],
+      "repository" : {
+         "url" : "http://github.com/toddr/Sys-Mmap/tree/master"
+      }
+   },
+   "version" : "0.17"
+}
@@ -1,30 +1,30 @@
---- #YAML:1.0
-name:               Sys-Mmap
-version:            0.16
-abstract:           uses mmap to map in a file as a Perl variable
+---
+abstract: 'uses mmap to map in a file as a Perl variable'
 author:
-    - Scott Walters <swalters@cpan.org>
-license:            perl
-distribution_type:  module
-configure_requires:
-    ExtUtils::MakeMaker:  0
+  - 'Scott Walters <swalters@cpan.org>'
 build_requires:
-    Errno:                0
-    ExtUtils::MakeMaker:  0
-    Test::More:           0
+  Errno: 0
+  ExtUtils::MakeMaker: 0
+  Test::More: 0
+configure_requires:
+  ExtUtils::MakeMaker: 0
+dynamic_config: 1
+generated_by: 'ExtUtils::MakeMaker version 6.62, CPAN::Meta::Converter version 2.120921'
+license: perl
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: 1.4
+name: Sys-Mmap
+no_index:
+  directory:
+    - t
+    - inc
 requires:
-    DynaLoader:  0
-    Test::More:  0
-    XSLoader:    0
+  DynaLoader: 0
+  Test::More: 0
+  XSLoader: 0
 resources:
-    homepage:    http://wiki.github.com/toddr/Sys-Mmap
-    license:     http://dev.perl.org/licenses/
-    repository:  http://github.com/toddr/Sys-Mmap/tree/master
-no_index:
-    directory:
-        - t
-        - inc
-generated_by:       ExtUtils::MakeMaker version 6.56
-meta-spec:
-    url:      http://module-build.sourceforge.net/META-spec-v1.4.html
-    version:  1.4
+  bugtracker: https://github.com/toddr/Sys-Mmap/issues
+  license: http://dev.perl.org/licenses/
+  repository: http://github.com/toddr/Sys-Mmap/tree/master
+version: 0.17
@@ -23,8 +23,8 @@ WriteMakefile(
         },
         resources => {
             license => 'http://dev.perl.org/licenses/',
-            homepage => 'http://wiki.github.com/toddr/Sys-Mmap',
-#            bugtracker => 'http://code.google.com/p/Sys-Mmap/issues/list',
+#            homepage => 'http://wiki.github.com/toddr/Sys-Mmap',
+            bugtracker => 'https://github.com/toddr/Sys-Mmap/issues',
             repository => 'http://github.com/toddr/Sys-Mmap/tree/master',
 #            MailingList => 'http://groups.google.com/group/Sys-Mmap',
         },
@@ -170,12 +170,11 @@ mmap()'d previously, or if it has since been reallocated by Perl.
 
 =head1 AUTHOR
 
-Malcolm Beattie, 21 June 1996.
+Todd Rinaldo cleaned up code, modernized again, and merged in many fixes, 2010-2011.
 
-Updated for Perl 5.6.x, additions, Scott Walters, Feb 2002.
+Scott Walters updated for Perl 5.6.x, additions, 2002.
 
-Aaron Kaplan kindly contributed patches to make the C ANSI
-compliant and contributed documentation as well.
+Malcolm Beattie, 21 June 1996.
 
 =cut
 
@@ -185,10 +184,10 @@ require Exporter;
 @ISA = qw(Exporter);
 
 @EXPORT = qw(mmap munmap
-	     MAP_ANON MAP_ANONYMOUS MAP_FILE MAP_PRIVATE MAP_SHARED
+	     MAP_ANON MAP_ANONYMOUS MAP_FILE MAP_LOCKED MAP_PRIVATE MAP_SHARED
 	     PROT_EXEC PROT_NONE PROT_READ PROT_WRITE);
 
-$VERSION = '0.16';
+$VERSION = '0.17';
 
 sub new {
 
@@ -76,6 +76,12 @@ int arg;
 #else
 	    goto not_there;
 #endif
+        if (strEQ(name, "MAP_LOCKED"))
+#ifdef MAP_LOCKED
+            return MAP_LOCKED;
+#else
+            goto not_there;
+#endif
 	break;
     case 'P':
 	if (strEQ(name, "PROT_EXEC"))
@@ -207,6 +213,12 @@ mmap(var, len, prot, flags, fh = 0, off_string)
 	if (addr == MAP_FAILED) {
             croak("mmap: mmap call failed: errno: %d errmsg: %s ", errno, strerror(errno));
         }
+#if PERL_VERSION >= 20
+
+        if (SvIsCOW(var)) {
+            sv_force_normal_flags(var, 0);
+        }
+#endif
 
 	SvUPGRADE(var, SVt_PV);
 	if (!(prot & PROT_WRITE))
@@ -230,8 +242,8 @@ munmap(var)
             croak("undef variable not unmappable");
             return;
 	}
-	if(SvTYPE(var) != SVt_PV) {
-            croak("variable is not a string");
+        if(SvTYPE(var) < SVt_PV || SvTYPE(var) > SVt_PVMG) {
+           croak("variable is not a string, type is: %d", SvTYPE(var));
             return;
         }