mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 16:18:12 +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
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "FileSystem.h"
|
||||
#include <AK/ByteBuffer.h>
|
||||
#include <AK/HashMap.h>
|
||||
|
||||
class DiskBackedFileSystem : public FileSystem {
|
||||
public:
|
||||
|
@ -27,4 +28,5 @@ protected:
|
|||
private:
|
||||
unsigned m_blockSize { 0 };
|
||||
RetainPtr<DiskDevice> m_device;
|
||||
mutable HashMap<unsigned, ByteBuffer> m_blockCache;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue