Skip to content

Commit

Permalink
use make_shared to create singleton (#1004)
Browse files Browse the repository at this point in the history
Summary:
Hi, this change fixes a compiler-related issue in our internal environment.

`make_shared` is recommended over `std::shared_ptr(new)`. Although it's not broken in the open-source version, I still believe it is valuable to merge this change.

Pull Request resolved: #1004

Reviewed By: sraikund16

Differential Revision: D64775478

Pulled By: briancoutinho

fbshipit-source-id: 48b9bceace195de8fccc8f3ace9481e761641bb6
  • Loading branch information
oraluben authored and facebook-github-bot committed Oct 28, 2024
1 parent 660b583 commit 4504cdc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libkineto/src/CuptiCallbackApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void CuptiCallbackApi::__callback_switchboard(
std::shared_ptr<CuptiCallbackApi> CuptiCallbackApi::singleton() {
static const std::shared_ptr<CuptiCallbackApi> instance = [] {
std::shared_ptr<CuptiCallbackApi> inst =
std::shared_ptr<CuptiCallbackApi>(new CuptiCallbackApi());
std::make_shared<CuptiCallbackApi>();
return inst;
}();
return instance;
Expand Down

0 comments on commit 4504cdc

Please sign in to comment.