mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 01:29:42 -06:00
DiscIO: Get rid of a few explicit deletes
This commit is contained in:
@ -14,6 +14,7 @@
|
||||
// detect whether the file is a compressed blob, or just a big hunk of data, or a drive, and
|
||||
// automatically do the right thing.
|
||||
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include "Common/CommonTypes.h"
|
||||
@ -57,8 +58,6 @@ class SectorReader : public IBlobReader
|
||||
public:
|
||||
virtual ~SectorReader();
|
||||
|
||||
// A pointer returned by GetBlockData is invalidated as soon as GetBlockData, Read, or ReadMultipleAlignedBlocks is called again.
|
||||
const u8 *GetBlockData(u64 block_num);
|
||||
bool Read(u64 offset, u64 size, u8 *out_ptr) override;
|
||||
friend class DriveReader;
|
||||
|
||||
@ -69,10 +68,13 @@ protected:
|
||||
virtual bool ReadMultipleAlignedBlocks(u64 block_num, u64 num_blocks, u8 *out_ptr);
|
||||
|
||||
private:
|
||||
// A reference returned by GetBlockData is invalidated as soon as GetBlockData, Read, or ReadMultipleAlignedBlocks is called again.
|
||||
const std::vector<u8>& GetBlockData(u64 block_num);
|
||||
|
||||
enum { CACHE_SIZE = 32 };
|
||||
int m_blocksize;
|
||||
u8* m_cache[CACHE_SIZE];
|
||||
u64 m_cache_tags[CACHE_SIZE];
|
||||
std::array<std::vector<u8>, CACHE_SIZE> m_cache;
|
||||
std::array<u64, CACHE_SIZE> m_cache_tags;
|
||||
};
|
||||
|
||||
// Factory function - examines the path to choose the right type of IBlobReader, and returns one.
|
||||
|
Reference in New Issue
Block a user