From cbb263e350bab0a0c522998d4d82301a50dec67b Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Sun, 1 Aug 2021 02:55:57 -0700 Subject: Kernel: Remove OOM unsafe DoubleBuffer constructor Remove this dangerous and now unused constructor. --- Kernel/DoubleBuffer.cpp | 5 ----- Kernel/DoubleBuffer.h | 1 - 2 files changed, 6 deletions(-) diff --git a/Kernel/DoubleBuffer.cpp b/Kernel/DoubleBuffer.cpp index b549b8a047..3fe605713e 100644 --- a/Kernel/DoubleBuffer.cpp +++ b/Kernel/DoubleBuffer.cpp @@ -26,11 +26,6 @@ OwnPtr DoubleBuffer::try_create(size_t capacity) return adopt_own_if_nonnull(new (nothrow) DoubleBuffer(capacity, storage.release_nonnull())); } -DoubleBuffer::DoubleBuffer(size_t capacity) - : DoubleBuffer(capacity, KBuffer::try_create_with_size(capacity * 2, Region::Access::Read | Region::Access::Write, "DoubleBuffer").release_nonnull()) -{ -} - DoubleBuffer::DoubleBuffer(size_t capacity, NonnullOwnPtr storage) : m_write_buffer(&m_buffer1) , m_read_buffer(&m_buffer2) diff --git a/Kernel/DoubleBuffer.h b/Kernel/DoubleBuffer.h index f130bb592d..2527407a8a 100644 --- a/Kernel/DoubleBuffer.h +++ b/Kernel/DoubleBuffer.h @@ -17,7 +17,6 @@ namespace Kernel { class DoubleBuffer { public: [[nodiscard]] static OwnPtr try_create(size_t capacity = 65536); - explicit DoubleBuffer(size_t capacity = 65536); [[nodiscard]] KResultOr write(const UserOrKernelBuffer&, size_t); [[nodiscard]] KResultOr write(const u8* data, size_t size) { -- cgit v1.2.3