mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-17 16:30:30 +02: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:
1 parent
27eb38df8d
commit
df5020c439
1 file changed
+3
-2
+3
-2
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user