summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-08-01 02:55:57 -0700
committerAndreas Kling <kling@serenityos.org>2021-08-03 18:54:23 +0200
commitcbb263e350bab0a0c522998d4d82301a50dec67b (patch)
tree0b969de963482c823d5cea4132b31bd50e345520
parentca94a833374b3fec720cc8ee911b9824c3021828 (diff)
downloadserenity-cbb263e350bab0a0c522998d4d82301a50dec67b.zip
Kernel: Remove OOM unsafe DoubleBuffer constructor
Remove this dangerous and now unused constructor.
-rw-r--r--Kernel/DoubleBuffer.cpp5
-rw-r--r--Kernel/DoubleBuffer.h1
2 files changed, 0 insertions, 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> 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<KBuffer> 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<DoubleBuffer> try_create(size_t capacity = 65536);
- explicit DoubleBuffer(size_t capacity = 65536);
[[nodiscard]] KResultOr<size_t> write(const UserOrKernelBuffer&, size_t);
[[nodiscard]] KResultOr<size_t> write(const u8* data, size_t size)
{