Commit ec23b296 authored by Graham McVicker's avatar Graham McVicker
Browse files

got rid of a nasty memory leak with DnaAlignFeatures

parent dd000af2
......@@ -42,7 +42,7 @@ The rest of the documentation details each of the object methods. Internal metho
package Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor;
use vars qw(@ISA);
use vars qw(@ISA $SLICE_FEATURE_CACHE_SIZE);
use strict;
# Object preamble - inherits from Bio::EnsEMBL::Root
......@@ -52,7 +52,7 @@ use Bio::EnsEMBL::Utils::Cache;
@ISA = qw(Bio::EnsEMBL::DBSQL::BaseAdaptor);
my $SLICE_FEATURE_CACHE_SIZE = 12;
$SLICE_FEATURE_CACHE_SIZE = 4;
=head2 new
......@@ -73,6 +73,8 @@ sub new {
my $self = $class->SUPER::new(@args);
#initialize caching data structures
$self->{'_slice_feature_cache'} = {};
tie(%{$self->{'_slice_feature_cache'}},
'Bio::EnsEMBL::Utils::Cache',
$SLICE_FEATURE_CACHE_SIZE);
......
......@@ -662,6 +662,42 @@ sub get_SupportingFeatureAdaptor {
=head2 get_MarkerFeatureAdaptor
Arg [1] : none
Example : $mfa = $db_adaptor->get_MarkerFeatureAdaptor;
Description: Gets a MarkerFeatureAdaptor for this database
Returntype : Bio::EnsEMBL::Map::DBSQL::MarkerFeatureAdaptor
Exceptions : none
Caller : general
=cut
sub get_MarkerFeatureAdaptor {
my $self = shift;
return $self->_get_adaptor('Bio::EnsEMBL::Map::DBSQL::MarkerFeatureAdaptor');
}
=head2 get_MarkerAdaptor
Arg [1] : none
Example : $ma = $db_adaptor->get_MarkerAdaptor;
Description: Gets a MarkerAdaptor for this database
Returntype : Bio::EnsEMBL::Map::DBSQL::MarkerAdaptor
Exceptions : none
Caller : general
=cut
sub get_MarkerAdaptor {
my $self = shift;
return $self->_get_adaptor('Bio::EnsEMBL::Map::DBSQL::MarkerAdaptor');
}
=head2 list_supported_assemblies
Args : none
......
......@@ -32,6 +32,8 @@ use strict;
use Bio::EnsEMBL::DBSQL::ProxyAdaptor;
use Bio::EnsEMBL::DBSQL::DnaAlignFeatureAdaptor;
use Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor;
use Bio::EnsEMBL::Utils::Cache;
package Bio::EnsEMBL::DBSQL::ProxyDnaAlignFeatureAdaptor;
......@@ -46,6 +48,39 @@ use vars qw(@ISA);
@ISA = qw(Bio::EnsEMBL::DBSQL::ProxyAdaptor
Bio::EnsEMBL::DBSQL::DnaAlignFeatureAdaptor);
=head2 new
Arg [1] : @args passed to ProxyAdaptor::new
Example : none
Description: This is needed to initialise the tied hash correctly which
is present in the DnaAlignFeatureAdaptor
Returntype : Bio::EnsEMBL::DBSQL::ProxyDnaAlignFeatureAdaptor
Exceptions : none
Caller : general
=cut
sub new {
my $caller = shift;
my $class = ref $caller || $caller;
my $self = $class->SUPER::new(@_);
#initialize caching data structures
$self->{'_slice_feature_cache'} = {};
tie(%{$self->{'_slice_feature_cache'}},
'Bio::EnsEMBL::Utils::Cache',
$Bio::EnsEMBL::DBSQL::BaseFeatureAdaptor::SLICE_FEATURE_CACHE_SIZE);
return $self;
}
#override generic_fetch_method to call appropriate db
=head2 generic_fetch
......
......@@ -1321,6 +1321,7 @@ sub accession_number {
}
=head2 sub DEPRECATED methods
=cut
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment