mem-cache: Fix non-virtual base destructor of Repl Entry
authorDaniel R. Carvalho <odanrc@yahoo.com.br>
Sat, 3 Aug 2019 10:04:14 +0000 (12:04 +0200)
committerDaniel Carvalho <odanrc@yahoo.com.br>
Wed, 7 Aug 2019 06:49:57 +0000 (06:49 +0000)
ReplaceableEntry contains a virtual method, yet its destructor
was not virtual, causing errors in some compilers.

Change-Id: I13deec843f4007d9deb924882a8d98ff6a89c84f
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19808
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
src/mem/cache/replacement_policies/replaceable_entry.hh

index dffa4cf106d90a8078782812a16acd6a9fba20b8..c558beea1653fcc780c546fbd9ff67f56e0f7365 100644 (file)
@@ -63,12 +63,15 @@ class ReplaceableEntry
      */
     uint32_t _way;
 
-   public:
-     /**
-      * Replacement data associated to this entry.
-      * It must be instantiated by the replacement policy before being used.
-      */
-     std::shared_ptr<ReplacementData> replacementData;
+  public:
+    ReplaceableEntry() = default;
+    virtual ~ReplaceableEntry() = default;
+
+    /**
+     * Replacement data associated to this entry.
+     * It must be instantiated by the replacement policy before being used.
+     */
+    std::shared_ptr<ReplacementData> replacementData;
 
     /**
      * Set both the set and way. Should be called only once.