mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:27:35 +00:00
Add a very naive block cache to the DiskBackedFileSystem.
This would be a lot better as an LRU. Right now it's a 32-slot hash table with random eviction.
This commit is contained in:
parent
82bbfa8496
commit
fdc782c1d1
4 changed files with 36 additions and 3 deletions
|
@ -216,7 +216,7 @@ public:
|
|||
remove(it);
|
||||
}
|
||||
|
||||
void remove(Iterator&);
|
||||
void remove(Iterator);
|
||||
|
||||
private:
|
||||
Bucket& lookup(const T&, unsigned* bucketIndex = nullptr);
|
||||
|
@ -329,7 +329,7 @@ auto HashTable<T, TraitsForT>::find(const T& value) const -> ConstIterator
|
|||
}
|
||||
|
||||
template<typename T, typename TraitsForT>
|
||||
void HashTable<T, TraitsForT>::remove(Iterator& it)
|
||||
void HashTable<T, TraitsForT>::remove(Iterator it)
|
||||
{
|
||||
ASSERT(!isEmpty());
|
||||
m_buckets[it.m_bucketIndex].chain.remove(it.m_bucketIterator);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue