1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:27:45 +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:
Andreas Kling 2018-10-25 12:35:49 +02:00
parent 82bbfa8496
commit fdc782c1d1
4 changed files with 36 additions and 3 deletions

View file

@ -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);