mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-11 02:13:56 +09:00
Kernel: Remove KBufferBuilder's can_expand restriction
KBufferBuilder is always allowed to expand if it wants to. This restriction was added a long time ago when it was unsafe to allocate VM while generating ProcFS contents.
This commit is contained in:
parent
fef835de7f
commit
f85b94e6d4
Notes:
sideshowbarker
2024-07-18 08:40:43 +09:00
Author: https://github.com/awesomekling
Commit: f85b94e6d4
2 changed files with 2 additions and 6 deletions
|
@ -15,8 +15,6 @@ inline bool KBufferBuilder::check_expand(size_t size)
|
|||
return false;
|
||||
if ((m_size + size) < m_buffer->capacity())
|
||||
return true;
|
||||
if (!m_can_expand)
|
||||
return false;
|
||||
if (Checked<size_t>::addition_would_overflow(m_size, size))
|
||||
return false;
|
||||
size_t new_buffer_size = m_size + size;
|
||||
|
@ -42,9 +40,8 @@ OwnPtr<KBuffer> KBufferBuilder::build()
|
|||
return try_make<KBuffer>(move(m_buffer));
|
||||
}
|
||||
|
||||
KBufferBuilder::KBufferBuilder(bool can_expand)
|
||||
KBufferBuilder::KBufferBuilder()
|
||||
: m_buffer(KBufferImpl::try_create_with_size(4 * MiB, Region::Access::Read | Region::Access::Write))
|
||||
, m_can_expand(can_expand)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue