Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/13208

Change subject: mem-cache: Make boundaries in FALRU an STL container
......................................................................

mem-cache: Make boundaries in FALRU an STL container

Turn the dynamically allocated array of pointers "boundaries"
into a STL vector.

Change-Id: I3409898473b155f69b4c6e038eba2dffb5b09380
Signed-off-by: Daniel R. Carvalho <[email protected]>
---
M src/mem/cache/tags/fa_lru.hh
1 file changed, 3 insertions(+), 7 deletions(-)



diff --git a/src/mem/cache/tags/fa_lru.hh b/src/mem/cache/tags/fa_lru.hh
index e21ae8a..30e4bbc 100644
--- a/src/mem/cache/tags/fa_lru.hh
+++ b/src/mem/cache/tags/fa_lru.hh
@@ -53,6 +53,7 @@
 #include <functional>
 #include <string>
 #include <unordered_map>
+#include <vector>

 #include "base/bitfield.hh"
 #include "base/intmath.hh"
@@ -275,7 +276,7 @@
             : blkSize(block_size), numTrackedCaches(num_tracked_caches),
               minTrackedSize(size >> (numTrackedCaches - 1)),
               inAllCachesMask(mask(numTrackedCaches - 1)),
-              boundaries(new FALRUBlk *[numTrackedCaches - 1])
+              boundaries(numTrackedCaches - 1)
         {
             fatal_if(minTrackedSize <= 0,
"Minimum tracked cache size must be greater than zero.");
@@ -287,11 +288,6 @@
                      numTrackedCaches);
         }

-        ~CacheTracking()
-        {
-            delete[] boundaries;
-        }
-
         /**
          * Initialiaze cache blocks and the tracking mechanism
          *
@@ -363,7 +359,7 @@
         /** A mask for all cache being tracked. */
         const CachesMask inAllCachesMask;
         /** Array of pointers to blocks at the cache boundaries. */
-        FALRUBlk** boundaries;
+        std::vector<FALRUBlk*> boundaries;

       protected:
         /**

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/13208
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I3409898473b155f69b4c6e038eba2dffb5b09380
Gerrit-Change-Number: 13208
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to