changeset 2c6a72e919f6 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=2c6a72e919f6
description:
base: Transition CP annotate to use shared_ptr
diffstat:
src/base/cp_annotate.cc | 4 ++--
src/base/cp_annotate.hh | 5 +++--
2 files changed, 5 insertions(+), 4 deletions(-)
diffs (50 lines):
diff -r b16b7dc83139 -r 2c6a72e919f6 src/base/cp_annotate.cc
--- a/src/base/cp_annotate.cc Thu Oct 16 05:49:46 2014 -0400
+++ b/src/base/cp_annotate.cc Thu Oct 16 05:49:47 2014 -0400
@@ -822,7 +822,7 @@
CPA::AnnDataPtr
CPA::add(int t, int f, int c, int sm, int stq, int32_t d)
{
- AnnDataPtr an = new AnnotateData;
+ AnnDataPtr an = std::make_shared<AnnotateData>();
an->time = curTick();
an->data = d;
an->orig_data = d;
@@ -1373,7 +1373,7 @@
if (!qSize[x])
continue;
for (int y = 0; y < qSize[x]; y++) {
- AnnDataPtr a = new AnnotateData;
+ AnnDataPtr a = std::make_shared<AnnotateData>();
a->unserialize(cp, csprintf("%s.Q%d_%d", section, x, y));
data.push_back(a);
qData[x].push_back(a);
diff -r b16b7dc83139 -r 2c6a72e919f6 src/base/cp_annotate.hh
--- a/src/base/cp_annotate.hh Thu Oct 16 05:49:46 2014 -0400
+++ b/src/base/cp_annotate.hh Thu Oct 16 05:49:47 2014 -0400
@@ -45,6 +45,7 @@
#include <list>
#include <map>
+#include <memory>
#include <string>
#include <vector>
@@ -189,7 +190,7 @@
}
/* struct that is written to the annotation output file */
- struct AnnotateData : public RefCounted {
+ struct AnnotateData {
Tick time;
uint32_t data;
@@ -206,7 +207,7 @@
};
- typedef RefCountingPtr<AnnotateData> AnnDataPtr;
+ typedef std::shared_ptr<AnnotateData> AnnDataPtr;
/* header for the annotation file */
struct AnnotateHeader {
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev