cpu: Use a unique_ptr to manage cached disassembly.
This is a fairly minor improvement, but avoids having to manually keep track of that string pointer. Change-Id: Ic3d4ddd9445920a110b36ab0cd64ff2289cf0139 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/42967 Maintainer: Gabe Black <gabe.black@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
This commit is contained in:
@@ -283,7 +283,7 @@ class StaticInst : public RefCounted, public StaticInstFlags
|
||||
* String representation of disassembly (lazily evaluated via
|
||||
* disassemble()).
|
||||
*/
|
||||
mutable std::string *cachedDisassembly = nullptr;
|
||||
mutable std::unique_ptr<std::string> cachedDisassembly;
|
||||
|
||||
/**
|
||||
* Internal function to generate disassembly string.
|
||||
@@ -301,7 +301,7 @@ class StaticInst : public RefCounted, public StaticInstFlags
|
||||
{}
|
||||
|
||||
public:
|
||||
virtual ~StaticInst();
|
||||
virtual ~StaticInst() {};
|
||||
|
||||
virtual Fault execute(ExecContext *xc,
|
||||
Trace::InstRecord *traceData) const = 0;
|
||||
|
||||
Reference in New Issue
Block a user