diff options
author | user <user@localhost.localdomain> | 2019-12-26 13:31:23 -0800 |
---|---|---|
committer | user <user@localhost.localdomain> | 2019-12-26 13:31:23 -0800 |
commit | 1c0b4c8ea8e32dddef0da99bbac546952bb20e44 (patch) | |
tree | 45b7c1f593df2f80f07727ff04d6ad53a23f3eef /starts/meaning-vm/level-0/ref.cpp | |
parent | dc2779f5a7ceb226620f39e728b73b028cb17c10 (diff) | |
download | standingwithresilience-1c0b4c8ea8e32dddef0da99bbac546952bb20e44.tar.gz standingwithresilience-1c0b4c8ea8e32dddef0da99bbac546952bb20e44.zip |
wip
Diffstat (limited to 'starts/meaning-vm/level-0/ref.cpp')
-rw-r--r-- | starts/meaning-vm/level-0/ref.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/starts/meaning-vm/level-0/ref.cpp b/starts/meaning-vm/level-0/ref.cpp index 87e911a..513d3ce 100644 --- a/starts/meaning-vm/level-0/ref.cpp +++ b/starts/meaning-vm/level-0/ref.cpp @@ -3,7 +3,9 @@ #include "errors.hpp" #include "memorystore.hpp" +#include <iomanip> #include <ostream> +#include <sstream> using namespace intellect::level0; using namespace concepts; @@ -13,10 +15,11 @@ std::string ref::dump(ref skipmarkertype, ref skipmarkertarget) if (self.linked(skipmarkertype, skipmarkertarget)) { return {}; } - std::string ret = std::to_string((unsigned long)ptr()) + ":\n"; + std::stringstream ss; + ss << std::hex << (size_t)ptr() << ":" << std::endl; for (auto & link : self.links()) { if (link.first.linked(allocator(), level0allocations())) { continue; } - ret += " " + std::to_string((unsigned long)link.first.ptr()) + ": " + std::to_string((unsigned long)link.second.ptr()) + "\n"; + ss << " " << (size_t)link.first.ptr() << ": " << (size_t)link.second.ptr() << std::endl; } self.link(skipmarkertype, skipmarkertarget); for (auto & link : self.links()) { @@ -24,7 +27,7 @@ std::string ref::dump(ref skipmarkertype, ref skipmarkertarget) if (link.first == skipmarkertype && link.second == skipmarkertarget) { continue; } - ret += link.second.dump(skipmarkertype, skipmarkertarget); + ss << link.second.dump(skipmarkertype, skipmarkertarget); } - return ret; + return ss.str(); } |