Filesystem: Read the entire FST in one go

Instead of using lots of small scattered reads to read the FST,
only one big read is used, which is more efficient.

This also means that the FST only allocates memory once and stores all
strings close to each other - good for the CPU cache. The file info
objects use pointers to this FST memory of containing data themselves.
Keeping around the big m_FileInfoVector containing objects with only
pointers is a bit unnecessary, but that will be fixed soon.
This commit is contained in:
JosJuice
2015-07-30 22:18:20 +02:00
parent f49b64caff
commit d6ee7ec32c
3 changed files with 80 additions and 62 deletions

View File

@ -26,9 +26,9 @@ public:
// Not guaranteed to return a meaningful value for directories
virtual u64 GetOffset() const = 0;
// Not guaranteed to return a meaningful value for directories
virtual u64 GetSize() const = 0;
virtual u32 GetSize() const = 0;
virtual bool IsDirectory() const = 0;
virtual const std::string& GetName() const = 0;
virtual std::string GetName() const = 0;
};
class FileSystem