diff options
author | Daniel R. Carvalho <odanrc@yahoo.com.br> | 2018-10-03 14:49:57 +0200 |
---|---|---|
committer | Daniel Carvalho <odanrc@yahoo.com.br> | 2018-10-05 18:42:49 +0000 |
commit | 079a16d16373ff739785a923649180a20f977489 (patch) | |
tree | a1167af75ac469f244addd34eb915a2b344f7287 /src/mem | |
parent | bb007aa738b5383fc038b134aaf7d2082a6a22c8 (diff) | |
download | gem5-079a16d16373ff739785a923649180a20f977489.tar.xz |
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 <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/13208
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/mem')
-rw-r--r-- | src/mem/cache/tags/fa_lru.hh | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/mem/cache/tags/fa_lru.hh b/src/mem/cache/tags/fa_lru.hh index 55362a424..03af572b8 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" @@ -272,7 +273,7 @@ class FALRU : public BaseTags numTrackedCaches(max_size > min_size ? floorLog2(max_size) - floorLog2(min_size) : 0), inAllCachesMask(mask(numTrackedCaches)), - boundaries(new FALRUBlk *[numTrackedCaches]) + boundaries(numTrackedCaches) { fatal_if(numTrackedCaches > sizeof(CachesMask) * 8, "Not enough bits (%s) in type CachesMask type to keep " @@ -280,11 +281,6 @@ class FALRU : public BaseTags numTrackedCaches); } - ~CacheTracking() - { - delete[] boundaries; - } - /** * Initialiaze cache blocks and the tracking mechanism * @@ -356,7 +352,7 @@ class FALRU : public BaseTags /** 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: /** |