summaryrefslogtreecommitdiff
path: root/src/mem/cache/base.cc
diff options
context:
space:
mode:
authorRobert Kovacsics <rmk35@cl.cam.ac.uk>2018-07-13 14:38:00 +0100
committerKovacsics RĂ³bert <kovirobi@gmail.com>2018-07-25 13:57:24 +0000
commit2fe3d660260e7b546b5860ac4459014ed9bee907 (patch)
tree9ddb798f793db1743b6d31dbeed860bfb3c1a173 /src/mem/cache/base.cc
parentcd3e7230bee7f557a54bbd908879ce090bc46978 (diff)
downloadgem5-2fe3d660260e7b546b5860ac4459014ed9bee907.tar.xz
mem-cache: TempCacheBlk allocates and destroys its own data
This change is because I want to make CacheBlk::data private, so that I can track all the places which write to it. But to keep that commit smaller (it is pretty big, because of all the places which might change it), I have split this into a commit of its own. Change-Id: I15a2fc1752085ff3681f5c74ec90be3828a559ea Reviewed-on: https://gem5-review.googlesource.com/11829 Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com> Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Diffstat (limited to 'src/mem/cache/base.cc')
-rw-r--r--src/mem/cache/base.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/mem/cache/base.cc b/src/mem/cache/base.cc
index 862aa3a94..a0614100f 100644
--- a/src/mem/cache/base.cc
+++ b/src/mem/cache/base.cc
@@ -113,8 +113,7 @@ BaseCache::BaseCache(const BaseCacheParams *p, unsigned blk_size)
// forward snoops is overridden in init() once we can query
// whether the connected master is actually snooping or not
- tempBlock = new TempCacheBlk();
- tempBlock->data = new uint8_t[blkSize];
+ tempBlock = new TempCacheBlk(blkSize);
tags->setCache(this);
if (prefetcher)
@@ -123,7 +122,6 @@ BaseCache::BaseCache(const BaseCacheParams *p, unsigned blk_size)
BaseCache::~BaseCache()
{
- delete [] tempBlock->data;
delete tempBlock;
}