Skip to content

Commit

Permalink
Re-implement and simplify my_share_hek, now in terms of share_hek.
Browse files Browse the repository at this point in the history
PL_strtab hack gone. This fixed the shared_hek destruction problems.
  • Loading branch information
Reini Urban committed Jan 31, 2012
1 parent d0eb89b commit 7fa2a88
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
2 changes: 2 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
1.42 2012-02-01 rurban
C: Improved finding methods in parent classes (Warning: method not found),
Save @ISA of those child classes.
Re-implement and simplify my_share_hek, now in terms of share_hek.
PL_strtab hack gone. This fixed the shared_hek destruction problems.

1.41 2012-01-30 rurban
t/modules.t: Fixed syntax error
Expand Down
17 changes: 4 additions & 13 deletions lib/B/C.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2686,7 +2686,7 @@ sub B::CV::save {
}
}
if ( $$root || $cvxsub ) {
warn "Successful forced autoload\n" if $verbose;
warn "Successful forced autoload\n" if $verbose and $debug{cv};
}
}
}
Expand Down Expand Up @@ -4210,19 +4210,9 @@ sub output_main_rest {
HEK *
my_share_hek( pTHX_ const char *str, I32 len, register U32 hash ) {
if (!hash) {
register HE* he;
/* XXX use hv_common_key_len if we start supporting UTF8 */
if (!(he = (HE *) hv_common(PL_strtab, NULL, str, len, 0, 0, NULL, 0))) {
/* Does not work with DEBUGGING as there is an artifical assert in hv.c
which checks that a HE is allocated before the HEK. */
HvSHAREKEYS_on(PL_strtab); /* XXX This is a hack! */
he = (HE *) hv_common(PL_strtab, NULL, str, len, 0, HV_FETCH_ISSTORE, NULL, 0);
HvSHAREKEYS_off(PL_strtab);
}
return HeKEY_hek(he);
} else {
return Perl_share_hek(aTHX_ str, len, hash);
PERL_HASH(hash, str, len);
}
return Perl_share_hek(aTHX_ str, len, hash);
}
_EOT5
Expand Down Expand Up @@ -4715,6 +4705,7 @@ EOT
exit( exitstatus );
dl_init(aTHX);
EOT

print $B::C::eval_pvs if $B::C::eval_pvs;
print " exitstatus = perl_run( my_perl );\n";

Expand Down

0 comments on commit 7fa2a88

Please sign in to comment.