mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 02:47:35 +00:00
Kernel: Merge PurgeableVMObject into AnonymousVMObject
This implements memory commitments and lazy-allocation of committed memory.
This commit is contained in:
parent
b2a52f6208
commit
476f17b3f1
35 changed files with 937 additions and 564 deletions
|
@ -35,14 +35,15 @@ inline bool KBufferBuilder::can_append(size_t size) const
|
|||
{
|
||||
if (!m_buffer)
|
||||
return false;
|
||||
bool has_space = ((m_size + size) < m_buffer->size());
|
||||
ASSERT(has_space);
|
||||
return has_space;
|
||||
return ((m_size + size) < m_buffer->size());
|
||||
}
|
||||
|
||||
OwnPtr<KBuffer> KBufferBuilder::build()
|
||||
{
|
||||
m_buffer->set_size(m_size);
|
||||
if (!m_buffer)
|
||||
return {};
|
||||
if (!m_buffer->is_null())
|
||||
m_buffer->set_size(m_size);
|
||||
return m_buffer.release_nonnull();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue