mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 06:09:08 +00:00
Kernel: Use StringView instead of String in RingBuffer's constructor
This String was being copied into a KString internally anyways.
This commit is contained in:
parent
792b8ca13c
commit
618f123463
Notes:
sideshowbarker
2024-07-17 21:01:21 +09:00
Author: https://github.com/IdanHo
Commit: 618f123463
Pull-request: https://github.com/SerenityOS/serenity/pull/11848
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/bgianfo ✅
4 changed files with 7 additions and 8 deletions
|
@ -6,7 +6,6 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <Kernel/PhysicalAddress.h>
|
||||
#include <Kernel/UserOrKernelBuffer.h>
|
||||
|
||||
|
@ -14,7 +13,7 @@ namespace Kernel::Memory {
|
|||
|
||||
class RingBuffer {
|
||||
public:
|
||||
RingBuffer(String region_name, size_t capacity);
|
||||
RingBuffer(StringView region_name, size_t capacity);
|
||||
|
||||
bool has_space() const { return m_num_used_bytes < m_capacity_in_bytes; }
|
||||
bool copy_data_in(const UserOrKernelBuffer& buffer, size_t offset, size_t length, PhysicalAddress& start_of_copied_data, size_t& bytes_copied);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue