mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 21:00:06 +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:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user