mem-cache: Make checking function const in FALRU
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Wed, 3 Oct 2018 12:55:31 +0000 (14:55 +0200)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Fri, 5 Oct 2018 18:42:49 +0000 (18:42 +0000)
The checking function should not be able to modify either
the head and tail pointers nor should it modify its class.

Change-Id: I2ad495f0c8c6b778d48512143e94b4c9a353f22e
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/13209
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

src/mem/cache/tags/fa_lru.cc
src/mem/cache/tags/fa_lru.hh

index 60998e254b731b7e4bc4937553a79d0f45dd7fa8..604bd7d07fa0b5679421fbf6ef7cd53762fdcd4f 100644 (file)
@@ -283,10 +283,10 @@ FALRUParams::create()
 }
 
 void
-FALRU::CacheTracking::check(FALRUBlk *head, FALRUBlk *tail)
+FALRU::CacheTracking::check(const FALRUBlk *head, const FALRUBlk *tail) const
 {
 #ifdef FALRU_DEBUG
-    FALRUBlk* blk = head;
+    const FALRUBlk* blk = head;
     unsigned curr_size = 0;
     unsigned tracked_cache_size = minTrackedSize;
     CachesMask in_caches_mask = inAllCachesMask;
index 03af572b876a8007f3b89a897eae5ecbaa0a3181..43e58040f272c54e77d5468e2e8c57f0c4e4e26d 100644 (file)
@@ -335,7 +335,7 @@ class FALRU : public BaseTags
          * @param head the MRU block of the actual cache
          * @param head the LRU block of the actual cache
          */
-        void check(FALRUBlk *head, FALRUBlk *tail);
+        void check(const FALRUBlk *head, const FALRUBlk *tail) const;
 
         /**
          * Register the stats for this object.