-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate VFSCacheArchiveFiles, will rely on the OS to provide caching
Remove CBufferedArchive as part of the previous Remove mutex lock from GetFile() in CZipArchive and CSevenZipArchive by opening up to ThreadPool::GetThreadNum() instances of archive files in a lazy manner
- Loading branch information
Showing
13 changed files
with
169 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,9 +5,10 @@ | |
|
||
#include <zlib.h> | ||
#include <cstring> | ||
#include <cassert> | ||
|
||
#include "IArchiveFactory.h" | ||
#include "BufferedArchive.h" | ||
#include "IArchive.h" | ||
|
||
|
||
/** | ||
|
@@ -72,7 +73,7 @@ class CPoolArchiveFactory : public IArchiveFactory { | |
* | ||
* @author Chris Clearwater (det) <[email protected]> | ||
*/ | ||
class CPoolArchive : public CBufferedArchive | ||
class CPoolArchive : public IArchive | ||
{ | ||
public: | ||
CPoolArchive(const std::string& name); | ||
|
@@ -83,7 +84,7 @@ class CPoolArchive : public CBufferedArchive | |
bool IsOpen() override { return isOpen; } | ||
|
||
unsigned NumFiles() const override { return (files.size()); } | ||
void FileInfo(unsigned int fid, std::string& name, int& size) const override { | ||
void FileInfo(uint32_t fid, std::string& name, int& size) const override { | ||
assert(IsFileId(fid)); | ||
name = files[fid].name; | ||
size = files[fid].size; | ||
|
@@ -95,15 +96,15 @@ class CPoolArchive : public CBufferedArchive | |
|
||
// pool-entry hashes are not calculated until GetFileImpl, must check JIT | ||
if (memcmp(fd.shasum.data(), dummyFileHash.data(), sizeof(fd.shasum)) == 0) | ||
GetFileImpl(fid, fb); | ||
GetFile(fid, fb); | ||
|
||
memcpy(hash, fd.shasum.data(), sha512::SHA_LEN); | ||
return (memcmp(fd.shasum.data(), dummyFileHash.data(), sizeof(fd.shasum)) != 0); | ||
} | ||
static std::string GetPoolRootDirectory(const std::string& sdpName); | ||
protected: | ||
int GetFileImpl(unsigned int fid, std::vector<std::uint8_t>& buffer) override; | ||
bool GetFile(uint32_t fid, std::vector<std::uint8_t>& buffer) override; | ||
|
||
static std::string GetPoolRootDirectory(const std::string& sdpName); | ||
private: | ||
std::pair<uint64_t, uint64_t> GetSums() const { | ||
std::pair<uint64_t, uint64_t> p; | ||
|
||
|
Oops, something went wrong.