summaryrefslogtreecommitdiff
path: root/Kernel
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-02-13 21:41:21 +0200
committerAndreas Kling <kling@serenityos.org>2022-02-13 23:02:57 +0100
commit197ebe3433112e1e4354c4434f094f90fe597260 (patch)
tree7ea8efb42c7d93d6a94f0680fc815bac317735eb /Kernel
parentb32cf33a23064394fc0bd694262fee523cd98b58 (diff)
downloadserenity-197ebe3433112e1e4354c4434f094f90fe597260.zip
Kernel: Remove dead code from ThreadSafeWeakPtr
This is a Kernel-only header, so any #ifndef KERNEL code is essentially dead.
Diffstat (limited to 'Kernel')
-rw-r--r--Kernel/Library/ThreadSafeWeakPtr.h15
1 files changed, 0 insertions, 15 deletions
diff --git a/Kernel/Library/ThreadSafeWeakPtr.h b/Kernel/Library/ThreadSafeWeakPtr.h
index 46e0b44d28..c0642ff079 100644
--- a/Kernel/Library/ThreadSafeWeakPtr.h
+++ b/Kernel/Library/ThreadSafeWeakPtr.h
@@ -138,17 +138,6 @@ public:
return ref;
}
-#ifndef KERNEL
- // A lot of user mode code is single-threaded. But for kernel mode code
- // this is generally not true as everything is multi-threaded. So make
- // these shortcuts and aliases only available to non-kernel code.
- T* ptr() const { return unsafe_ptr(); }
- T* operator->() { return unsafe_ptr(); }
- const T* operator->() const { return unsafe_ptr(); }
- operator const T*() const { return unsafe_ptr(); }
- operator T*() { return unsafe_ptr(); }
-#endif
-
[[nodiscard]] T* unsafe_ptr() const
{
T* ptr = nullptr;
@@ -219,12 +208,8 @@ template<typename T>
struct Formatter<WeakPtr<T>> : Formatter<const T*> {
ErrorOr<void> format(FormatBuilder& builder, WeakPtr<T> const& value)
{
-#ifdef KERNEL
auto ref = value.strong_ref();
return Formatter<const T*>::format(builder, ref.ptr());
-#else
- return Formatter<const T*>::format(builder, value.ptr());
-#endif
}
};