mem-cache: Fix non-bijective function in Skewed caches
[gem5.git] / src / mem / cache / blk.hh
index 97e1d42d9b53557894157fb8209e5bba9dcefb74..3bb0317cc43b7c4b6a9c6164ee86291036e67305 100644 (file)
@@ -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.