From: Daniel R. Carvalho Date: Wed, 3 Oct 2018 12:49:57 +0000 (+0200) Subject: mem-cache: Make boundaries in FALRU an STL container X-Git-Tag: v19.0.0.0~1656 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=079a16d16373ff739785a923649180a20f977489;p=gem5.git 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 Reviewed-on: https://gem5-review.googlesource.com/c/13208 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- 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 #include #include +#include #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 boundaries; protected: /**