sub read_txn_slots {
my $self = shift;
- my $bl = $self->txn_bitfield_len;
- my $num_bits = $bl * 8;
- return split '', unpack( 'b'.$num_bits,
- $self->storage->read_at(
- $self->trans_loc, $bl,
- )
- );
+ return $self->_load_header->read_txn_slots;
}
sub write_txn_slots {
return $loc;
}
+sub read_txn_slots {
+ my $self = shift;
+ my $e = $self->engine;
+ my $bl = $e->txn_bitfield_len;
+ my $num_bits = $bl * 8;
+ return split '', unpack( 'b'.$num_bits, $self->read( $e->trans_loc, $bl ) );
+}
+
1;
__END__
use Fcntl qw( :DEFAULT :flock :seek );
-use constant DEBUG => 1;
+use constant DEBUG => 0;
sub new {
my $class = shift;
my $self = shift;
my $loc = shift;
- warn "print_at called\n";
local ($/,$\);
my $fh = $self->{fh};
plan tests => 9;
+my $locked = 0;
+
use_ok( 'DBM::Deep' );
diag "This test can take up to a minute to run. Please be patient.";
type => DBM::Deep->TYPE_HASH,
);
-#$db->lock_exclusive;
+$db->lock_exclusive if $locked;
$db->{foo} = {};
my $foo = $db->{foo};
my @control = sort map { "hello $_" } 0 .. $max_keys;
cmp_deeply( \@keys, \@control, "Correct keys are there" );
+warn localtime(time) . ": before exists\n";
ok( !exists $foo->{does_not_exist}, "EXISTS works on large hashes for non-existent keys" );
is( $foo->{does_not_exist}, undef, "autovivification works on large hashes" );
ok( exists $foo->{does_not_exist}, "EXISTS works on large hashes for newly-existent keys" );
warn localtime(time) . ": after clear\n";
cmp_ok( scalar(keys %$db), '==', 0, "Number of keys after clear() is correct" );
-#$db->unlock;
+$db->unlock if $locked;