diff options
Diffstat (limited to 'src/mem/cache/blk.hh')
-rw-r--r-- | src/mem/cache/blk.hh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mem/cache/blk.hh b/src/mem/cache/blk.hh index 97e1d42d9..3bb0317cc 100644 --- a/src/mem/cache/blk.hh +++ b/src/mem/cache/blk.hh @@ -406,10 +406,17 @@ class TempCacheBlk final : public CacheBlk Addr _addr; public: - TempCacheBlk() : CacheBlk() {} + /** + * Creates a temporary cache block, with its own storage. + * @param size The size (in bytes) of this cache block. + */ + TempCacheBlk(unsigned size) : CacheBlk() + { + data = new uint8_t[size]; + } TempCacheBlk(const TempCacheBlk&) = delete; TempCacheBlk& operator=(const TempCacheBlk&) = delete; - ~TempCacheBlk() {}; + ~TempCacheBlk() { delete [] data; }; /** * Invalidate the block and clear all state. |