refactor: trace actor instance IDs instead of pointer values
This commit is contained in:
parent
5994549daf
commit
e430b209eb
1 changed files with 6 additions and 7 deletions
|
|
@ -276,6 +276,7 @@ struct instance : std::enable_shared_from_this<instance> {
|
||||||
}
|
}
|
||||||
|
|
||||||
auto name() const -> const string & { return name_; }
|
auto name() const -> const string & { return name_; }
|
||||||
|
auto instance_id() const -> uintptr_t { return instance_id_; }
|
||||||
|
|
||||||
auto is_enabled(channel c) -> bool { return env_.enabled(c); }
|
auto is_enabled(channel c) -> bool { return env_.enabled(c); }
|
||||||
|
|
||||||
|
|
@ -532,18 +533,16 @@ auto operator==(const handle &a, const handle &b) -> bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
auto ref_m(const void *p, string name) -> buffer {
|
auto ref_m(uintptr_t id, string name) -> buffer {
|
||||||
stringstream ss;
|
return array("PID", id, move(name));
|
||||||
ss << p;
|
|
||||||
return array("PID", ss.str(), move(name));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ref_m(const instance *p) -> buffer { return ref_m(p, p->name()); }
|
auto ref_m(const instance *p) -> buffer { return ref_m(p->instance_id(), p->name()); }
|
||||||
|
|
||||||
auto ref_m(const ref &r) -> buffer {
|
auto ref_m(const ref &r) -> buffer {
|
||||||
if (auto p = r.lock())
|
if (auto p = r.lock())
|
||||||
return ref_m(p.get(), p->name());
|
return ref_m(p->instance_id(), p->name());
|
||||||
return ref_m(nullptr, "none");
|
return ref_m(0, "none");
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue