mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-12-03 03:03:50 +01:00
A bit more GetPointer cleanup.
Probably not worth it for performance reasons, but some semantic cleanup is good, especially the accidental GetPointer -> writable casts without using GetPointerWrite. Using Unchecked on already checked pointers, or when we'd crash anyway if it returned nullptr, is good for clarity.
This commit is contained in:
1 parent
70e149e3ca
commit
e1a48d74c4
11 files changed
+42
-26
No files matched your search
@@ -65,7 +65,12 @@ static uint64_t HashJitBlock(const JitBlock &b) {
|
||||
PROFILE_THIS_SCOPE("jithash");
|
||||
if (JIT_USE_COMPILEDHASH) {
|
||||
// Includes the emuhack (or emuhacks) in memory.
|
||||
return XXH3_64bits(Memory::GetPointerRange(b.originalAddress, b.originalSize * 4), b.originalSize * 4);
|
||||
if (Memory::IsValidRange(b.originalAddress, b.originalSize * 4)) {
|
||||
return XXH3_64bits(Memory::GetPointerUnchecked(b.originalAddress), b.originalSize * 4);
|
||||
} else {
|
||||
// Hm, this would be bad.
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user