From 8bb7aba78568b9bc8f25d5daef543fa2e78beefd Mon Sep 17 00:00:00 2001 From: David Turner Date: Sun, 7 Oct 2001 11:06:07 +0000 Subject: [PATCH] * src/cache/ftlru.c (FT_Lru_Lookup_Node): fixed a bug that prevented correct LRU behaviour --- ChangeLog | 5 +++++ src/cache/ftlru.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9b7748b18..bc83214f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2001-10-07 Richard Barber + + * src/cache/ftlru.c (FT_Lru_Lookup_Node): fixed a bug that prevented + correct LRU behaviour + 2001-10-07 David Turner * src/smooth/ftgrays: "setjmp/longjmp" is now used for rollback (i.e. diff --git a/src/cache/ftlru.c b/src/cache/ftlru.c index 7b9254566..2838847a7 100644 --- a/src/cache/ftlru.c +++ b/src/cache/ftlru.c @@ -177,7 +177,12 @@ } } - if ( !found ) + if ( found ) + { + /* move element to top of list */ + FT_List_Up( &lru->elements, node ); + } + else { /* we haven't found the relevant element. We will now try */ /* to create a new one. */