return $self;
}
-sub clear {
+sub wipe {
my $self = shift;
$self->engine->storage->print_at( $self->offset + $self->base_size,
chr(0) x ($self->size - $self->base_size), # Zero-fill the data
return $self->{size};
}
-sub free_meth { return '_add_free_blist_sector' }
+sub free_meth { '_add_free_blist_sector' }
sub free {
my $self = shift;
# Delete the keysector
my $l = unpack( $StP{$e->byte_size}, substr( $rest, $e->hash_size, $e->byte_size ) );
- my $s = DBM::Deep::Sector::File->load( $e, $l ); $s->free if $s;
+ my $s = $e->load_sector( $l ); $s->free if $s;
# Delete the HEAD sector
$l = unpack( $StP{$e->byte_size},
$e->byte_size,
),
);
- $s = DBM::Deep::Sector::File->load( $e, $l ); $s->free if $s;
+ $s = $e->load_sector( $l ); $s->free if $s;
foreach my $txn ( 0 .. $e->num_txns - 2 ) {
my $l = unpack( $StP{$e->byte_size},
$e->byte_size,
),
);
- my $s = DBM::Deep::Sector::File->load( $e, $l ); $s->free if $s;
+ my $s = $e->load_sector( $l ); $s->free if $s;
}
}
$key_sector->free;
- my $data_sector = DBM::Deep::Sector::File->load( $self->engine, $location );
+ my $data_sector = $self->engine->load_sector( $location );
my $data = $data_sector->data({ export => 1 });
$data_sector->free;
my $location = $self->get_data_location_for({
allow_head => $args->{allow_head},
});
- return DBM::Deep::Sector::File->load( $self->engine, $location );
+ return $self->engine->load_sector( $location );
}
sub get_key_for {
$location = unpack( $StP{$self->engine->byte_size}, $location );
DBM::Deep->_throw_error( "get_key_for: No location?" ) unless $location;
- return DBM::Deep::Sector::File->load( $self->engine, $location );
+ return $self->engine->load_sector( $location );
}
1;