From cc87cd1bc5f4ac0673348e3bc1ccc54fff542892 Mon Sep 17 00:00:00 2001 From: Yuhanun Citgez Date: Wed, 5 Feb 2020 23:39:18 +0100 Subject: [PATCH 1/2] Modernized unique_ptr construction --- src/debug_utils.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/debug_utils.cc b/src/debug_utils.cc index 984c04eb2d381d..b1fc489939c69d 100644 --- a/src/debug_utils.cc +++ b/src/debug_utils.cc @@ -100,16 +100,14 @@ class PosixSymbolDebuggingContext final : public NativeSymbolDebuggingContext { std::unique_ptr NativeSymbolDebuggingContext::New() { - return std::unique_ptr( - new PosixSymbolDebuggingContext()); + return std::make_unique(); } #else // HAVE_EXECINFO_H std::unique_ptr NativeSymbolDebuggingContext::New() { - return std::unique_ptr( - new NativeSymbolDebuggingContext()); + return std::unique_ptr(); } #endif // HAVE_EXECINFO_H From 7c623742fd3ad46f5d7e7e8df71a9366f79ecfbf Mon Sep 17 00:00:00 2001 From: Yuhanun Citgez Date: Thu, 6 Feb 2020 17:41:40 +0100 Subject: [PATCH 2/2] Resolved an issue where a unique_ptr would not allocate Co-Authored-By: Timothy Gu --- src/debug_utils.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/debug_utils.cc b/src/debug_utils.cc index b1fc489939c69d..4553b642b65837 100644 --- a/src/debug_utils.cc +++ b/src/debug_utils.cc @@ -107,7 +107,7 @@ NativeSymbolDebuggingContext::New() { std::unique_ptr NativeSymbolDebuggingContext::New() { - return std::unique_ptr(); + return std::make_unique(); } #endif // HAVE_EXECINFO_H