Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

releng

  • Loading branch information...
commit 4c55754480f37cf8a3e7c2a6d74761e72eefc45b 1 parent e0b41b7
@nothingmuch authored
View
12 dist.ini
@@ -0,0 +1,12 @@
+name = Cache-Ref
+version = 0.01
+author = Yuval Kogman
+license = Perl_5
+copyright_holder = Yuval Kogman
+
+[@Filter]
+-bundle = @NUFFIN
+
+dist = Cache-Ref
+repository_at = github
+
View
14 lib/Cache/Ref.pm
@@ -3,9 +3,7 @@ use Moose;
__PACKAGE__->meta->make_immutable;
-__PACKAGE__
-
-__END__
+__PACKAGE__;
=pod
@@ -171,16 +169,6 @@ L<http://www.almaden.ibm.com/cs/people/dmodha/clockfast.pdf>
L<http://github.com/nothingmuch/Cache-Ref>
-=head1 AUTHOR
-
-Yuval Kogman
-
-=head1 COPYRIGHT & LICENSE
-
- Copyright (c) 2010 Yuval Kogman. All rights reserved
- This program is free software; you can redistribute
- it and/or modify it under the same terms as Perl itself.
-
=cut
# ex: set sw=4 et:
View
6 lib/Cache/Ref/CAR.pm
@@ -136,9 +136,7 @@ sub _clear_additional { }
__PACKAGE__->meta->make_immutable;
-__PACKAGE__
-
-__END__
+__PACKAGE__;
=pod
@@ -155,7 +153,7 @@ Cache::Ref::CAR - CLOCK with Adaptive Replacement
=head1 DESCRIPTION
This algorithm is an implementation of
-L<L<http://www.almaden.ibm.com/cs/people/dmodha/clockfast.pdf|CAR: Clock with Adaptive Replacement, Sorav Bansal and Dharmendra S. Modha>.
+L<http://www.almaden.ibm.com/cs/people/dmodha/clockfast.pdf|CAR: Clock with Adaptive Replacement, Sorav Bansal and Dharmendra S. Modha>.
See also L<Cache::Ref::CART> which is probably more appropriate for random access work loads.
View
4 lib/Cache/Ref/CAR/Base.pm
@@ -385,9 +385,7 @@ sub remove {
return;
}
-__PACKAGE__
-
-__END__
+__PACKAGE__;
# ex: set sw=4 et:
View
20 lib/Cache/Ref/CART.pm
@@ -89,7 +89,7 @@ sub _increase_mru_history_target_size {
my $self = shift;
$self->_set_mru_history_target_size( min($self->_mru_history_target_size + 1, 2 * $self->size - $self->_mru_size ) );
-}
+}
sub _decrease_mru_history_target_size {
my $self = shift;
@@ -100,12 +100,7 @@ sub _decrease_mru_history_target_size {
sub _restore_from_mfu_history {
my ( $self, $e ) = @_;
- # FIXME brain is off
- if ( $self->_mfu_size + $self->_mru_size + $self->_mfu_history_size -
- ( $self->_mfu_size + $self->_mru_size - $self->_long_term_utility_size )
- >=
- $self->size
- ) {
+ if ( $self->_mfu_history_size + $self->_long_term_utility_size >= $self->size ) {
$self->_increase_mru_history_target_size();
}
@@ -140,12 +135,7 @@ sub _expire {
$self->_mru_push($cur);
$cur = $self->_next($cur);
- # FIXME brain is off
- if ( $self->_mfu_size + $self->_mru_size + $self->_mfu_history_size -
- ( $self->_mfu_size + $self->_mru_size - $self->_long_term_utility_size )
- >=
- $self->size
- ) {
+ if ( $self->_mfu_history_size + $self->_long_term_utility_size >= $self->size ) {
$self->_increase_mru_history_target_size;
}
}
@@ -227,9 +217,7 @@ sub _clear_additional {
__PACKAGE__->meta->make_immutable;
-__PACKAGE__
-
-__END__
+__PACKAGE__;
=pod
View
6 lib/Cache/Ref/CLOCK.pm
@@ -22,9 +22,7 @@ sub _hit {
__PACKAGE__->meta->make_immutable;
-__PACKAGE__
-
-__END__
+__PACKAGE__;
=pod
@@ -57,7 +55,7 @@ a bit to 1)).
The size of the live entries.
-=head1 k
+=item k
This is the initial value given to all hit entries.
View
8 lib/Cache/Ref/CLOCK/Base.pm
@@ -34,7 +34,7 @@ has _buffer => (
sub hit {
my ( $self, @keys ) = @_;
-
+
$self->_hit( [ grep { defined } $self->_index_get(@keys) ] );
return;
@@ -77,7 +77,7 @@ sub set {
sub _find_free_slot {
my $self = shift;
-
+
my $i = $self->_hand;
my $b = $self->_buffer;
@@ -102,7 +102,5 @@ sub _find_free_slot {
# ex: set sw=4 et:
-__PACKAGE__
-
-__END__
+__PACKAGE__;
View
4 lib/Cache/Ref/FIFO.pm
@@ -72,7 +72,5 @@ __PACKAGE__->meta->make_immutable;
# ex: set sw=4 et:
-__PACKAGE__
-
-__END__
+__PACKAGE__;
View
4 lib/Cache/Ref/GCLOCK.pm
@@ -15,9 +15,7 @@ sub _hit {
__PACKAGE__->meta->make_immutable;
-__PACKAGE__
-
-__END__
+__PACKAGE__;
=head1 NAME
View
6 lib/Cache/Ref/LRU.pm
@@ -88,9 +88,7 @@ sub remove {
__PACKAGE__->meta->make_immutable;
-__PACKAGE__
-
-__END__
+__PACKAGE__;
=head1 NAME
@@ -117,7 +115,7 @@ L<Cache::Ref> for a discussion.
The size of the live entries.
-=head lru_class
+=item lru_class
The class of the LRU list implementation.
View
4 lib/Cache/Ref/Role/API.pm
@@ -30,7 +30,5 @@ sub compute {
# ex: set sw=4 et:
-__PACKAGE__
-
-__END__
+__PACKAGE__;
View
4 lib/Cache/Ref/Role/Index.pm
@@ -40,7 +40,5 @@ sub _index_delete {
# ex: set sw=4 et:
-__PACKAGE__
-
-__END__
+__PACKAGE__;
View
4 lib/Cache/Ref/Role/WithDoublyLinkedList.pm
@@ -182,7 +182,5 @@ role {
# ex: set sw=4 et:
-__PACKAGE__
-
-__END__
+__PACKAGE__;
View
6 lib/Cache/Ref/Util/LRU/API.pm
@@ -16,9 +16,7 @@ requires qw(
remove_lru
);
-# ex: set sw=4 et:
-
-__PACKAGE__
+__PACKAGE__;
-__END__
+# ex: set sw=4 et:
View
8 lib/Cache/Ref/Util/LRU/Array.pm
@@ -26,7 +26,7 @@ with qw(Cache::Ref::Util::LRU::API);
# since there's no need for metadata, insert is just like hit
sub insert {
my ( $self, @elements ) = @_;
-
+
$self->hit(@elements);
return ( @elements == 1 ? $elements[0] : @elements );
@@ -66,9 +66,7 @@ sub remove {
__PACKAGE__->meta->make_immutable;
-# ex: set sw=4 et:
-
-__PACKAGE__
+__PACKAGE__;
-__END__
+# ex: set sw=4 et:
View
6 lib/Cache/Ref/Util/LRU/List.pm
@@ -56,9 +56,7 @@ sub DEMOLISH { shift->clear }
__PACKAGE__->meta->make_immutable;
-# ex: set sw=4 et:
-
-__PACKAGE__
+__PACKAGE__;
-__END__
+# ex: set sw=4 et:
Please sign in to comment.
Something went wrong with that request. Please try again.