shared_ptr (#5830)

This commit is contained in:
Edward Oakes
2019-10-02 16:29:04 -07:00
committed by GitHub
parent 26834bcf94
commit 4e049232a8
4 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -51,8 +51,8 @@ CoreWorker::CoreWorker(
RAY_CHECK_OK(gcs_client_->Connect(io_service_));
// Initialize profiler.
profiler_ = std::unique_ptr<worker::Profiler>(
new worker::Profiler(worker_context_, node_ip_address, io_service_, gcs_client_));
profiler_ = std::make_shared<worker::Profiler>(worker_context_, node_ip_address,
io_service_, gcs_client_);
object_interface_ =
std::unique_ptr<CoreWorkerObjectInterface>(new CoreWorkerObjectInterface(
+1 -1
View File
@@ -101,7 +101,7 @@ class CoreWorker {
boost::asio::io_service::work io_work_;
std::thread io_thread_;
std::unique_ptr<worker::Profiler> profiler_;
std::shared_ptr<worker::Profiler> profiler_;
std::unique_ptr<RayletClient> raylet_client_;
std::unique_ptr<gcs::RedisGcsClient> gcs_client_;
std::unique_ptr<CoreWorkerTaskInterface> task_interface_;
+1 -1
View File
@@ -6,7 +6,7 @@ namespace ray {
namespace worker {
ProfileEvent::ProfileEvent(const std::unique_ptr<Profiler> &profiler,
ProfileEvent::ProfileEvent(const std::shared_ptr<Profiler> profiler,
const std::string &event_type)
: profiler_(profiler) {
rpc_event_.set_event_type(event_type);
+2 -2
View File
@@ -37,7 +37,7 @@ class Profiler {
class ProfileEvent {
public:
ProfileEvent(const std::unique_ptr<Profiler> &profiler, const std::string &event_type);
ProfileEvent(const std::shared_ptr<Profiler> profiler, const std::string &event_type);
~ProfileEvent() {
rpc_event_.set_end_time(current_sys_time_seconds());
@@ -49,7 +49,7 @@ class ProfileEvent {
}
private:
const std::unique_ptr<Profiler> &profiler_;
const std::shared_ptr<Profiler> profiler_;
rpc::ProfileTableData::ProfileEvent rpc_event_;
};