JIT: Allow more blocks to be stored in the cache. Also, add margin to the IsFull check.

This commit is contained in:
Henrik Rydgård 2024-10-28 12:17:05 +01:00
parent c30ec47937
commit cf678a1aa6
3 changed files with 5 additions and 4 deletions

View File

@ -71,6 +71,7 @@ void Shutdown()
#endif
}
// NOTE: Due to the nature of getaddrinfo, this can block indefinitely. Not good.
bool DNSResolve(const std::string &host, const std::string &service, addrinfo **res, std::string &error, DNSType type) {
#if PPSSPP_PLATFORM(SWITCH)
// Force IPv4 lookups.

View File

@ -91,8 +91,8 @@ bool JitBlock::ContainsAddress(u32 em_address) const {
}
bool JitBlockCache::IsFull() const {
// -10 to safely leave space for some proxy blocks, which we don't check before we allocate (not ideal, but should work).
return num_blocks_ >= MAX_NUM_BLOCKS - 10;
// Subtract some amount to safely leave space for some proxy blocks, which we don't check before we allocate (not ideal, but should be enough).
return num_blocks_ >= MAX_NUM_BLOCKS - 512;
}
void JitBlockCache::Init() {
@ -218,7 +218,6 @@ void JitBlockCache::ProxyBlock(u32 rootAddress, u32 startAddress, u32 size, cons
void JitBlockCache::AddBlockMap(int block_num) {
const JitBlock &b = blocks_[block_num];
// Convert the logical address to a physical address for the block map
// Yeah, this'll work fine for PSP too I think.
u32 pAddr = b.originalAddress & 0x1FFFFFFF;
block_map_[std::make_pair(pAddr + 4 * b.originalSize, pAddr)] = block_num;
}

View File

@ -227,7 +227,8 @@ private:
std::pair<u32, u32> blockMemRanges_[3];
enum {
MAX_NUM_BLOCKS = 65536*2
// Where does this number come from?
MAX_NUM_BLOCKS = 65536 * 4
};
};