mirror of
https://github.com/hrydgard/ppsspp.git
synced 2024-11-27 07:20:49 +00:00
Treat generation 0 a bit specially.
I guess we could always check gen 0 first, that'd be readahead/backfill.
This commit is contained in:
parent
27eb38df8d
commit
df5020c439
@ -538,11 +538,12 @@ bool CachingFileLoader::MakeCacheSpaceFor(size_t blocks, bool readingAhead) {
|
||||
for (auto it = blocks_.begin(); it != blocks_.end(); ) {
|
||||
// Check for the minimum seen generation.
|
||||
// TODO: Do this smarter?
|
||||
if (it->second.generation < minGeneration) {
|
||||
if (it->second.generation != 0 && it->second.generation < minGeneration) {
|
||||
minGeneration = it->second.generation;
|
||||
}
|
||||
|
||||
if (it->second.generation == oldestGeneration_) {
|
||||
// 0 means it was never used yet or was the first read (e.g. block descriptor.)
|
||||
if (it->second.generation == oldestGeneration_ || it->second.generation == 0) {
|
||||
s64 pos = it->first;
|
||||
delete it->second.ptr;
|
||||
blocks_.erase(it);
|
||||
|
Loading…
Reference in New Issue
Block a user