mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:37:35 +00:00
Kernel: Add KBuffer::bytes() and use it
(Instead of hand-wrapping { data(), size() } in a bunch of places.)
This commit is contained in:
parent
bee2de4b31
commit
524ef5e475
7 changed files with 9 additions and 7 deletions
|
@ -42,6 +42,9 @@ public:
|
|||
[[nodiscard]] size_t size() const { return m_size; }
|
||||
[[nodiscard]] size_t capacity() const { return m_region->size(); }
|
||||
|
||||
[[nodiscard]] ReadonlyBytes bytes() const { return { data(), size() }; }
|
||||
[[nodiscard]] Bytes bytes() { return { data(), size() }; }
|
||||
|
||||
void set_size(size_t size)
|
||||
{
|
||||
VERIFY(size <= capacity());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue