mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 04:37:55 +00:00
DiskBackedFS: Flush write cache if it reaches 32 entries before sync.
This is just to avoid chewing through all of the kernel memory. There is a lot of room for improvement here, and 32 is just a number from the place where numbers come from.
This commit is contained in:
@@ -69,6 +69,10 @@ bool DiskBackedFS::write_block(unsigned index, const ByteBuffer& data)
|
||||
|
||||
LOCKER(m_lock);
|
||||
m_write_cache.set(index, data.isolated_copy());
|
||||
|
||||
if (m_write_cache.size() >= 32)
|
||||
flush_writes();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user