base: Transition CP annotate to use shared_ptr

This commit is contained in:
Andreas Hansson
2014-10-16 05:49:47 -04:00
parent ad3f75dc81
commit 8b789ae451
2 changed files with 5 additions and 4 deletions

View File

@@ -822,7 +822,7 @@ CPA::swSyscallLink(ThreadContext *tc)
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 @@ CPA::unserialize(Checkpoint *cp, const std::string &section)
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);

View File

@@ -45,6 +45,7 @@
#include <list>
#include <map>
#include <memory>
#include <string>
#include <vector>
@@ -189,7 +190,7 @@ class CPA : SimObject
}
/* struct that is written to the annotation output file */
struct AnnotateData : public RefCounted {
struct AnnotateData {
Tick time;
uint32_t data;
@@ -206,7 +207,7 @@ class CPA : SimObject
};
typedef RefCountingPtr<AnnotateData> AnnDataPtr;
typedef std::shared_ptr<AnnotateData> AnnDataPtr;
/* header for the annotation file */
struct AnnotateHeader {