From 969d884185af15ef1a7e27a0c83dc492f0146963 Mon Sep 17 00:00:00 2001 From: Esun Kim Date: Fri, 8 Nov 2019 22:46:08 -0800 Subject: [PATCH] Clean memory.h --- src/core/lib/gprpp/memory.h | 31 ++++--------------------------- 1 file changed, 4 insertions(+), 27 deletions(-) diff --git a/src/core/lib/gprpp/memory.h b/src/core/lib/gprpp/memory.h index 418924a70a4..8206c34ffe3 100644 --- a/src/core/lib/gprpp/memory.h +++ b/src/core/lib/gprpp/memory.h @@ -30,19 +30,6 @@ namespace grpc_core { -// TODO(veblush): Remove this after removing all usages. -template -inline T* New(Args&&... args) { - return new T(std::forward(args)...); -} - -// TODO(veblush): Remove this after removing all usages. -template -inline void Delete(T* p) { - delete p; -} - -// TODO(veblush): Remove this after removing all usages. class DefaultDeleteChar { public: void operator()(char* p) { @@ -51,21 +38,11 @@ class DefaultDeleteChar { } }; -// TODO(veblush): Remove this after removing all usages. -template -struct ResolveDeleter { - using deleter = std::default_delete; -}; -template <> -struct ResolveDeleter { - using deleter = DefaultDeleteChar; -}; - -// TODO(veblush): Remove this after removing all usages. -// This is equivalent to std::unique_ptr except that it uses gpr_free -// for deleter only for UniquePtr +// UniquePtr is only allowed for char and UniquePtr is deprecated +// in favor of std::string. UniquePtr is equivalent std::unique_ptr +// except that it uses gpr_free for deleter. template -using UniquePtr = std::unique_ptr::deleter>; +using UniquePtr = std::unique_ptr; // TODO(veblush): Replace this with absl::make_unique once abseil is added. template