From 3dc8bbbc8bb0844b8345304d3741e94d53d594e2 Mon Sep 17 00:00:00 2001 From: Idan Horowitz Date: Thu, 3 Feb 2022 16:46:01 +0200 Subject: [PATCH] Kernel: Remove the infallible make_ref_counted factory function This function had no users, nor should it ever be used, as all allocation failures in the Kernel should be explicitly checked. --- Kernel/Library/ThreadSafeNonnullRefPtr.h | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/Kernel/Library/ThreadSafeNonnullRefPtr.h b/Kernel/Library/ThreadSafeNonnullRefPtr.h index e6ff2cf5bf..932717e5f9 100644 --- a/Kernel/Library/ThreadSafeNonnullRefPtr.h +++ b/Kernel/Library/ThreadSafeNonnullRefPtr.h @@ -336,18 +336,6 @@ inline void swap(NonnullRefPtr& a, NonnullRefPtr& b) requires(IsConvertibl a.swap(b); } -template -requires(IsConstructible) inline NonnullRefPtr make_ref_counted(Args&&... args) -{ - return NonnullRefPtr(NonnullRefPtr::Adopt, *new T(forward(args)...)); -} - -// FIXME: Remove once P0960R3 is available in Clang. -template -inline NonnullRefPtr make_ref_counted(Args&&... args) -{ - return NonnullRefPtr(NonnullRefPtr::Adopt, *new T { forward(args)... }); -} } template @@ -359,5 +347,4 @@ struct Traits> : public GenericTraits> { }; using AK::adopt_ref; -using AK::make_ref_counted; using AK::NonnullRefPtr;