aboutsummaryrefslogtreecommitdiffhomepage
path: root/autoload.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-01-25 18:40:08 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-01-25 18:40:08 -0800
commit2f1cac604df280750a9a93edecb4e1a72fc5cff3 (patch)
treed9f76f8d84a1bbb6255155c13233fd64f37856df /autoload.cpp
parent8e56763c981789701a6ef655634c82873881617b (diff)
Implemented LRU cache for autoloading.
Diffstat (limited to 'autoload.cpp')
-rw-r--r--autoload.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/autoload.cpp b/autoload.cpp
index a886df52..0222bacf 100644
--- a/autoload.cpp
+++ b/autoload.cpp
@@ -172,6 +172,8 @@ lru_cache_impl_t::lru_cache_impl_t() : node_count(0), mouth(L"") {
mouth.prev = mouth.next = &mouth;
}
+void lru_cache_impl_t::node_was_evicted(lru_node_t *node) { }
+
void lru_cache_impl_t::evict_node(lru_node_t *condemned_node) {
/* We should never evict the mouth */
assert(condemned_node != NULL && condemned_node != &mouth);
@@ -184,8 +186,8 @@ void lru_cache_impl_t::evict_node(lru_node_t *condemned_node) {
node_set.erase(condemned_node);
node_count--;
- /* Tell it */
- condemned_node->evicted();
+ /* Tell ourselves */
+ this->node_was_evicted(condemned_node);
}
void lru_cache_impl_t::evict_last_node(void) {