Daniel Carvalho has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/17529

Change subject: mem-cache: Assert Entry inherits from QueueEntry in Queue
......................................................................

mem-cache: Assert Entry inherits from QueueEntry in Queue

Queue has several assumptions regarding its template parameter,
so make sure they are fulfilled by forcing Entry to be derived
from QueueEntry.

Change-Id: I0203a62aec00c04ac89e9674d86a44a07f9f13ab
Signed-off-by: Daniel R. Carvalho <[email protected]>
---
M src/mem/cache/queue.hh
1 file changed, 4 insertions(+), 0 deletions(-)



diff --git a/src/mem/cache/queue.hh b/src/mem/cache/queue.hh
index 36ddb96..6c8a192 100644
--- a/src/mem/cache/queue.hh
+++ b/src/mem/cache/queue.hh
@@ -51,6 +51,7 @@

 #include <cassert>
 #include <string>
+#include <type_traits>

 #include "base/logging.hh"
 #include "base/trace.hh"
@@ -68,6 +69,9 @@
 template<class Entry>
 class Queue : public Drainable
 {
+    static_assert(std::is_base_of<QueueEntry, Entry>::value,
+        "Entry must be derived from QueueEntry");
+
   protected:
     /** Local label (for functional print requests) */
     const std::string label;

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17529
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I0203a62aec00c04ac89e9674d86a44a07f9f13ab
Gerrit-Change-Number: 17529
Gerrit-PatchSet: 1
Gerrit-Owner: Daniel Carvalho <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to