OSDN Git Service

2004-05-10 Dave Brolley <brolley@redhat.com>
authorbrolley <brolley>
Mon, 10 May 2004 21:51:10 +0000 (21:51 +0000)
committerbrolley <brolley>
Mon, 10 May 2004 21:51:10 +0000 (21:51 +0000)
        * cacheutil.cxx (find_any_dirty): Make sure the line is valid before
        checking the dirty bit.
        (vacancy_p): Line is also vacant if it is not valid.

sid/component/cache/ChangeLog
sid/component/cache/cacheutil.cxx

index aa9cf8c..f3cad54 100644 (file)
@@ -1,3 +1,9 @@
+2004-05-10  Dave Brolley  <brolley@redhat.com>
+
+       * cacheutil.cxx (find_any_dirty): Make sure the line is valid before
+       checking the dirty bit.
+       (vacancy_p): Line is also vacant if it is not valid.
+
 2004-04-29  Dave Brolley  <brolley@redhat.com>
 
        * cacheutil.cxx (cache_set::expell_line): Don't update the set here.
index 9efcbff..9f3d75c 100644 (file)
@@ -189,7 +189,7 @@ cache_set::find_any_dirty ()
   for (iterator_t it = lines.begin (); it != lines.end (); it++)
     {
       cache_line* i = * it;
-      if (i->dirty_p ()) return i;
+      if (i->valid_p () && i->dirty_p ()) return i;
     }
 
   return 0;
@@ -206,7 +206,7 @@ bool
 cache_set::vacancy_p () const
 {
   for (const_iterator_t it = lines.begin (); it != lines.end (); it++)
-    if (!(*it)->locked_p ())
+    if (!(*it)->valid_p () || !(*it)->locked_p ())
       return true;
 
   return false;