mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-16 06:30:41 +00:00
Kernel: Remove unused KBufferImpl::expand()
This commit is contained in:
parent
2c262ddf0f
commit
be613b9ef6
|
@ -60,18 +60,6 @@ public:
|
|||
return buffer;
|
||||
}
|
||||
|
||||
[[nodiscard]] bool expand(size_t new_capacity)
|
||||
{
|
||||
auto new_region_or_error = MM.allocate_kernel_region(Memory::page_round_up(new_capacity), m_region->name(), m_region->access(), m_allocation_strategy);
|
||||
if (new_region_or_error.is_error())
|
||||
return false;
|
||||
auto new_region = new_region_or_error.release_value();
|
||||
if (m_size > 0)
|
||||
memcpy(new_region->vaddr().as_ptr(), data(), min(m_region->size(), m_size));
|
||||
m_region = move(new_region);
|
||||
return true;
|
||||
}
|
||||
|
||||
[[nodiscard]] u8* data() { return m_region->vaddr().as_ptr(); }
|
||||
[[nodiscard]] const u8* data() const { return m_region->vaddr().as_ptr(); }
|
||||
[[nodiscard]] size_t size() const { return m_size; }
|
||||
|
|
Loading…
Reference in a new issue