mirror of
https://github.com/libretro/ppsspp.git
synced 2025-03-02 05:36:43 +00:00
Make sure to reset memory protection as appropriate. Remove unused WriteProtect on codeblocks (to be redesigned)
This commit is contained in:
parent
323eb72b7c
commit
13e73f8c86
@ -60,6 +60,7 @@ public:
|
||||
void ClearCodeSpace() {
|
||||
PoisonMemory();
|
||||
ResetCodePtr();
|
||||
ProtectMemoryPages(region, region_size, MEM_PROT_READ | MEM_PROT_WRITE | MEM_PROT_EXEC);
|
||||
}
|
||||
|
||||
// Call this when shutting down. Don't rely on the destructor, even though it'll do the job.
|
||||
@ -73,12 +74,6 @@ public:
|
||||
region_size = 0;
|
||||
}
|
||||
|
||||
// Cannot currently be undone. Will write protect the entire code region.
|
||||
// Start over if you need to change the code (call FreeCodeSpace(), AllocCodeSpace()).
|
||||
void WriteProtect() {
|
||||
ProtectMemoryPages(region, region_size, MEM_PROT_READ | MEM_PROT_EXEC);
|
||||
}
|
||||
|
||||
void SetCodePtr(u8 *ptr) override {
|
||||
T::SetCodePointer(ptr);
|
||||
}
|
||||
|
@ -496,14 +496,6 @@ void MIPSCodeBlock::FreeCodeSpace() {
|
||||
region_size = 0;
|
||||
}
|
||||
|
||||
void MIPSCodeBlock::WriteProtect() {
|
||||
ProtectMemoryPages(region, region_size, MEM_PROT_READ | MEM_PROT_EXEC);
|
||||
}
|
||||
|
||||
void MIPSCodeBlock::UnWriteProtect() {
|
||||
ProtectMemoryPages(region, region_size, MEM_PROT_READ | MEM_PROT_EXEC | MEM_PROT_WRITE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -299,11 +299,6 @@ public:
|
||||
return ptr >= region && ptr < region + region_size;
|
||||
}
|
||||
|
||||
// Can possibly be undone. Will write protect the entire code region.
|
||||
// Start over if you need to change the code, though (call FreeCodeSpace(), AllocCodeSpace().)
|
||||
void WriteProtect();
|
||||
void UnWriteProtect();
|
||||
|
||||
void ResetCodePtr() {
|
||||
SetCodePtr(region);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user