summaryrefslogtreecommitdiff
path: root/Kernel/KBuffer.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-08-06 22:25:00 +0200
committerAndreas Kling <kling@serenityos.org>2021-08-06 22:25:00 +0200
commit2cd8b21974993052fdcb0bddfa62423dbeb6002a (patch)
tree25a7b2de5cf157d17ae71224cf3ae3ee3574959c /Kernel/KBuffer.h
parent47bdd7c3a01b7e21e56a5d1dd40b18e9ed43f466 (diff)
downloadserenity-2cd8b21974993052fdcb0bddfa62423dbeb6002a.zip
Kernel: Add convenience values to the Memory::Region::Access enum
Instead of `Memory::Region::Access::Read | Memory::Region::AccessWrite` you can now say `Memory::Region::Access::ReadWrite`.
Diffstat (limited to 'Kernel/KBuffer.h')
-rw-r--r--Kernel/KBuffer.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/Kernel/KBuffer.h b/Kernel/KBuffer.h
index a2ce51cfbb..1d74ca963b 100644
--- a/Kernel/KBuffer.h
+++ b/Kernel/KBuffer.h
@@ -104,7 +104,7 @@ public:
{
}
- [[nodiscard]] static OwnPtr<KBuffer> try_create_with_size(size_t size, Memory::Region::Access access = Memory::Region::Access::Read | Memory::Region::Access::Write, StringView name = "KBuffer", AllocationStrategy strategy = AllocationStrategy::Reserve)
+ [[nodiscard]] static OwnPtr<KBuffer> try_create_with_size(size_t size, Memory::Region::Access access = Memory::Region::Access::ReadWrite, StringView name = "KBuffer", AllocationStrategy strategy = AllocationStrategy::Reserve)
{
auto impl = KBufferImpl::try_create_with_size(size, access, name, strategy);
if (!impl)
@@ -112,7 +112,7 @@ public:
return adopt_own_if_nonnull(new (nothrow) KBuffer(impl.release_nonnull()));
}
- [[nodiscard]] static OwnPtr<KBuffer> try_create_with_bytes(ReadonlyBytes bytes, Memory::Region::Access access = Memory::Region::Access::Read | Memory::Region::Access::Write, StringView name = "KBuffer", AllocationStrategy strategy = AllocationStrategy::Reserve)
+ [[nodiscard]] static OwnPtr<KBuffer> try_create_with_bytes(ReadonlyBytes bytes, Memory::Region::Access access = Memory::Region::Access::ReadWrite, StringView name = "KBuffer", AllocationStrategy strategy = AllocationStrategy::Reserve)
{
auto impl = KBufferImpl::try_create_with_bytes(bytes, access, name, strategy);
if (!impl)
@@ -120,7 +120,7 @@ public:
return adopt_own_if_nonnull(new (nothrow) KBuffer(impl.release_nonnull()));
}
- [[nodiscard]] static KBuffer copy(const void* data, size_t size, Memory::Region::Access access = Memory::Region::Access::Read | Memory::Region::Access::Write, StringView name = "KBuffer")
+ [[nodiscard]] static KBuffer copy(const void* data, size_t size, Memory::Region::Access access = Memory::Region::Access::ReadWrite, StringView name = "KBuffer")
{
return KBuffer(KBufferImpl::copy(data, size, access, name));
}
@@ -141,7 +141,7 @@ public:
[[nodiscard]] const KBufferImpl& impl() const { return *m_impl; }
[[nodiscard]] RefPtr<KBufferImpl> take_impl() { return move(m_impl); }
- KBuffer(const ByteBuffer& buffer, Memory::Region::Access access = Memory::Region::Access::Read | Memory::Region::Access::Write, StringView name = "KBuffer")
+ KBuffer(const ByteBuffer& buffer, Memory::Region::Access access = Memory::Region::Access::ReadWrite, StringView name = "KBuffer")
: m_impl(KBufferImpl::copy(buffer.data(), buffer.size(), access, name))
{
}