Permalink
Browse files

Deal better with copy-on-write

  • Loading branch information...
1 parent 1b76bb0 commit c47ceb2cd90cc8b321a385530a92e1efb6d86d20 @Leont committed Dec 8, 2012
Showing with 3 additions and 1 deletion.
  1. +1 −0 Changes
  2. +2 −1 lib/File/Map.xs
View
1 Changes
@@ -1,6 +1,7 @@
Revision history for File-Map
{{$NEXT}}
+ Deal better with copy-on-write
Remove Const::Fast dependency
0.53 2012-11-07 11:45:09 Europe/Amsterdam
View
3 lib/File/Map.xs
@@ -213,6 +213,7 @@ static void mmap_fixup(pTHX_ SV* var, struct mmap_info* info, const char* string
if (string && len)
Copy(string, info->fake_address, MIN(len, info->fake_length), char);
+ SV_CHECK_THINKFIRST_COW_DROP(var);
if (SvROK(var))
sv_unref_flags(var, SV_IMMEDIATE_UNREF);
if (SvPOK(var))
@@ -341,7 +342,7 @@ static Off_t S_sv_to_offset(pTHX_ SV* var) {
static void check_new_variable(pTHX_ SV* var) {
if (SvTYPE(var) > SVt_PVMG && SvTYPE(var) != SVt_PVLV)
Perl_croak(aTHX_ "Trying to map into a nonscalar!\n");
- SV_CHECK_THINKFIRST(var);
+ SV_CHECK_THINKFIRST_COW_DROP(var);
if (SvREADONLY(var))
Perl_croak(aTHX_ "%s", PL_no_modify);
if (SvMAGICAL(var) && mg_find(var, PERL_MAGIC_uvar))

0 comments on commit c47ceb2

Please sign in to comment.