char *s;
STRLEN len;
U32 hash = 0;
- char hexhash[11]; /* must fit "0xffffffff" plus trailing \0 */
+ char hexhash[19]; /* must fit "0xffffffff" plus trailing \0 */
s = SvPV(sv, len);
- while (len--)
- hash = hash * 33 + *s++;
+ PERL_HASH(hash, s, len);
sprintf(hexhash, "0x%x", hash);
ST(0) = sv_2mortal(newSVpv(hexhash, 0));
my ($key, $value) = splice(@contents, 0, 2);
$init->add(sprintf("\thv_store(hv, %s, %u, %s, %s);",
cstring($key),length($key),$value, hash($key)));
+# $init->add(sprintf("\thv_store(hv, %s, %u, %s, %s);",
+# cstring($key),length($key),$value, 0));
}
$init->add("}");
}
my $package = shift;
$package =~ s/::$//;
return $unused_sub_packages{$package} = 0 if ($package =~ /::::/); # skip ::::ISA::CACHE etc.
- warn "Considering $package\n";#debug
+ # warn "Considering $package\n";#debug
foreach my $u (grep($unused_sub_packages{$_},keys %unused_sub_packages))
{
# If this package is a prefix to something we are saving, traverse it
}
if (exists $unused_sub_packages{$package})
{
- warn "Cached $package is ".$unused_sub_packages{$package}."\n";
+ # warn "Cached $package is ".$unused_sub_packages{$package}."\n";
return $unused_sub_packages{$package}
}
# Omit the packages which we use (and which cause grief
# because of fancy "goto &$AUTOLOAD" stuff).
# XXX Surely there must be a nicer way to do this.
if ($package eq "FileHandle" || $package eq "Config" ||
- $package eq "SelectSaver" || $package =~/^B::/)
+ $package eq "SelectSaver" || $package =~/^(B|IO)::/)
{
return $unused_sub_packages{$package} = 0;
}